[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YHW/8AV5jZDjz+yP@kroah.com>
Date: Tue, 13 Apr 2021 17:59:44 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Tianyu Lan <ltykernel@...il.com>
Cc: kys@...rosoft.com, haiyangz@...rosoft.com, sthemmin@...rosoft.com,
wei.liu@...nel.org, Tianyu Lan <Tianyu.Lan@...rosoft.com>,
linux-hyperv@...r.kernel.org, linux-kernel@...r.kernel.org,
vkuznets@...hat.com, thomas.lendacky@....com,
brijesh.singh@....com, sunilmut@...rosoft.com
Subject: Re: [RFC V2 PATCH 8/12] UIO/Hyper-V: Not load UIO HV driver in the
isolation VM.
On Tue, Apr 13, 2021 at 11:22:13AM -0400, Tianyu Lan wrote:
> From: Tianyu Lan <Tianyu.Lan@...rosoft.com>
>
> UIO HV driver should not load in the isolation VM for security reason.
> Return ENOTSUPP in the hv_uio_probe() in the isolation VM.
>
> Signed-off-by: Tianyu Lan <Tianyu.Lan@...rosoft.com>
> ---
> drivers/uio/uio_hv_generic.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/drivers/uio/uio_hv_generic.c b/drivers/uio/uio_hv_generic.c
> index 0330ba99730e..678b021d66f8 100644
> --- a/drivers/uio/uio_hv_generic.c
> +++ b/drivers/uio/uio_hv_generic.c
> @@ -29,6 +29,7 @@
> #include <linux/hyperv.h>
> #include <linux/vmalloc.h>
> #include <linux/slab.h>
> +#include <asm/mshyperv.h>
No driver should be having to add "asm" include files.
>
> #include "../hv/hyperv_vmbus.h"
>
> @@ -241,6 +242,10 @@ hv_uio_probe(struct hv_device *dev,
> void *ring_buffer;
> int ret;
>
> + /* UIO driver should not be loaded in the isolation VM.*/
> + if (hv_is_isolation_supported())
> + return -ENOTSUPP;
> +
> /* Communicating with host has to be via shared memory not hypercall */
> if (!channel->offermsg.monitor_allocated) {
> dev_err(&dev->device, "vmbus channel requires hypercall\n");
> --
> 2.25.1
>
Always run checkpatch.pl on your patches so you do not get grumpy
maintainers telling you to run checkpatch.pl on your patch :(
{sigh}
Powered by blists - more mailing lists