um: virtio_uml: disallow modular build
diff mbox series

Message ID 1570549401-Ia2c524a2c48a33cecd9d956898cebe358a37563d@changeid
State New
Headers show
Series
  • um: virtio_uml: disallow modular build
Related show

Commit Message

Johannes Berg Oct. 8, 2019, 3:43 p.m. UTC
From: Johannes Berg <johannes.berg@intel.com>

This driver *can* be a module, but then its parameters (socket path)
are untrusted data from inside the VM, and that isn't allowed. Allow
the code to only be built-in to avoid that.

Fixes: 5d38f324993f ("um: drivers: Add virtio vhost-user driver")
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
---
 arch/um/drivers/Kconfig      | 2 +-
 arch/um/drivers/virtio_uml.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Anton Ivanov Oct. 8, 2019, 4:16 p.m. UTC | #1
On 08/10/2019 16:43, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
> 
> This driver *can* be a module, but then its parameters (socket path)
> are untrusted data from inside the VM, and that isn't allowed. Allow
> the code to only be built-in to avoid that.
> 
> Fixes: 5d38f324993f ("um: drivers: Add virtio vhost-user driver")
> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
> ---
>   arch/um/drivers/Kconfig      | 2 +-
>   arch/um/drivers/virtio_uml.c | 4 ++--
>   2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/um/drivers/Kconfig b/arch/um/drivers/Kconfig
> index fea5a0d522dc..388096fb45a2 100644
> --- a/arch/um/drivers/Kconfig
> +++ b/arch/um/drivers/Kconfig
> @@ -337,7 +337,7 @@ config UML_NET_SLIRP
>   endmenu
>   
>   config VIRTIO_UML
> -	tristate "UML driver for virtio devices"
> +	bool "UML driver for virtio devices"
>   	select VIRTIO
>   	help
>   	  This driver provides support for virtio based paravirtual device
> diff --git a/arch/um/drivers/virtio_uml.c b/arch/um/drivers/virtio_uml.c
> index fc8c52cff5aa..511f595a3c3d 100644
> --- a/arch/um/drivers/virtio_uml.c
> +++ b/arch/um/drivers/virtio_uml.c
> @@ -4,12 +4,12 @@
>    *
>    * Copyright(c) 2019 Intel Corporation
>    *
> - * This module allows virtio devices to be used over a vhost-user socket.
> + * This driver allows virtio devices to be used over a vhost-user socket.
>    *
>    * Guest devices can be instantiated by kernel module or command line
>    * parameters. One device will be created for each parameter. Syntax:
>    *
> - *		[virtio_uml.]device=<socket>:<virtio_id>[:<platform_id>]
> + *		virtio_uml.device=<socket>:<virtio_id>[:<platform_id>]
>    * where:
>    *		<socket>	:= vhost-user socket path to connect
>    *		<virtio_id>	:= virtio device id (as in virtio_ids.h)
> 

Acked-by: Anton Ivanov <anton.ivanov@cambridgegreys.co.uk>

Patch
diff mbox series

diff --git a/arch/um/drivers/Kconfig b/arch/um/drivers/Kconfig
index fea5a0d522dc..388096fb45a2 100644
--- a/arch/um/drivers/Kconfig
+++ b/arch/um/drivers/Kconfig
@@ -337,7 +337,7 @@  config UML_NET_SLIRP
 endmenu
 
 config VIRTIO_UML
-	tristate "UML driver for virtio devices"
+	bool "UML driver for virtio devices"
 	select VIRTIO
 	help
 	  This driver provides support for virtio based paravirtual device
diff --git a/arch/um/drivers/virtio_uml.c b/arch/um/drivers/virtio_uml.c
index fc8c52cff5aa..511f595a3c3d 100644
--- a/arch/um/drivers/virtio_uml.c
+++ b/arch/um/drivers/virtio_uml.c
@@ -4,12 +4,12 @@ 
  *
  * Copyright(c) 2019 Intel Corporation
  *
- * This module allows virtio devices to be used over a vhost-user socket.
+ * This driver allows virtio devices to be used over a vhost-user socket.
  *
  * Guest devices can be instantiated by kernel module or command line
  * parameters. One device will be created for each parameter. Syntax:
  *
- *		[virtio_uml.]device=<socket>:<virtio_id>[:<platform_id>]
+ *		virtio_uml.device=<socket>:<virtio_id>[:<platform_id>]
  * where:
  *		<socket>	:= vhost-user socket path to connect
  *		<virtio_id>	:= virtio device id (as in virtio_ids.h)