linux/drivers/hv
Stanislav Kinsburskii 16cbec2489 mshv: Fix infinite fault loop on permission-denied GPA intercepts
Prevent infinite fault loops when guests access memory regions without
proper permissions. Currently, mshv_handle_gpa_intercept() attempts to
remap pages for all faults on movable memory regions, regardless of
whether the access type is permitted. When a guest writes to a read-only
region, the remap succeeds but the region remains read-only, causing
immediate re-fault and spinning the vCPU indefinitely.

Validate intercept access type against region permissions before
attempting remaps. Reject writes to non-writable regions and executes to
non-executable regions early, returning false to let the VMM handle the
intercept appropriately.

This also closes a potential DoS vector where malicious guests could
intentionally trigger these fault loops to consume host resources.

Fixes: b9a66cd5cc ("mshv: Add support for movable memory regions")
Signed-off-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Reviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
Signed-off-by: Wei Liu <wei.liu@kernel.org>
2026-04-04 05:25:53 +00:00
..
channel_mgmt.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
channel.c Drivers: hv: fix missing kernel-doc description for 'size' in request_arr_init() 2025-11-15 06:18:16 +00:00
connection.c Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL uses 2026-02-22 08:26:33 -08:00
hv_balloon.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
hv_common.c mshv: Handle insufficient root memory hypervisor statuses 2026-02-19 06:42:11 +00:00
hv_debugfs.c hv_debugfs: Make hv_debug_root static 2020-04-04 17:47:43 +01:00
hv_kvp.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hv_proc.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hv_snapshot.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hv_trace_balloon.h
hv_trace.c
hv_trace.h Drivers: hv: vmbus: Drivers: hv: vmbus: Introduce CHANNELMSG_MODIFYCHANNEL_RESPONSE 2021-04-18 13:03:11 +00:00
hv_util.c Drivers: hv: use kmalloc_array() instead of kmalloc() 2025-12-05 23:16:49 +00:00
hv_utils_transport.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
hv_utils_transport.h
hv.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
hyperv_vmbus.h mshv: Use try_cmpxchg() instead of cmpxchg() 2026-02-18 23:27:20 +00:00
Kconfig mshv: Add support for movable memory regions 2025-12-05 23:20:49 +00:00
Makefile mshv: Add debugfs to view hypervisor statistics 2026-02-04 06:17:05 +00:00
mshv_common.c mshv: hide x86-specific functions on arm64 2025-12-17 18:04:15 +00:00
mshv_debugfs_counters.c mshv: Add data for printing stats page counters 2026-02-04 06:17:05 +00:00
mshv_debugfs.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mshv_eventfd.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mshv_eventfd.h mshv: clear eventfd counter on irqfd shutdown 2026-02-04 06:36:19 +00:00
mshv_irq.c treewide: Replace kmalloc with kmalloc_obj for non-scalar types 2026-02-21 01:02:28 -08:00
mshv_portid_table.c Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs 2025-03-21 18:24:22 +00:00
mshv_regions.c mshv: Fix error handling in mshv_region_pin 2026-03-18 16:18:49 +00:00
mshv_root_hv_call.c mshv: Introduce hv_deposit_memory helper functions 2026-02-19 06:38:48 +00:00
mshv_root_main.c mshv: Fix infinite fault loop on permission-denied GPA intercepts 2026-04-04 05:25:53 +00:00
mshv_root.h mshv: refactor synic init and cleanup 2026-02-25 19:09:24 +00:00
mshv_synic.c mshv: add arm64 support for doorbell & intercept SINTs 2026-02-25 19:09:49 +00:00
mshv_vtl_main.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
mshv_vtl.h Drivers: hv: Introduce mshv_vtl driver 2025-12-05 23:16:26 +00:00
mshv.h mshv: Use common "entry virt" APIs to do work in root before running guest 2025-09-30 22:50:48 +00:00
ring_buffer.c Convert more 'alloc_obj' cases to default GFP_KERNEL arguments 2026-02-21 20:03:00 -08:00
vmbus_drv.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00