Thread (34 messages) 34 messages, 7 authors, 2021-05-13
STALE1848d
Revisions (11)
  1. rfc [diff vs current]
  2. v2 [diff vs current]
  3. v2 current
  4. v3 [diff vs current]
  5. v4 [diff vs current]
  6. v4 [diff vs current]
  7. v1 [diff vs current]
  8. v2 [diff vs current]
  9. v3 [diff vs current]
  10. v4 [diff vs current]
  11. v5 [diff vs current]

[Resend RFC PATCH V2 08/12] UIO/Hyper-V: Not load UIO HV driver in the isolation VM.

From: Tianyu Lan <hidden>
Date: 2021-04-14 14:51:08
Also in: linux-arch, linux-hyperv, linux-iommu, linux-mm, linux-scsi, lkml
Subsystem: hyper-v/azure core and drivers, the rest, userspace i/o (uio) · Maintainers: "K. Y. Srinivasan", Haiyang Zhang, Wei Liu, Dexuan Cui, Long Li, Linus Torvalds, Greg Kroah-Hartman

From: Tianyu Lan <redacted>

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 <redacted>
---
 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>
 
 #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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help