]> git.ipfire.org Git - thirdparty/linux.git/commit
mshv: Fix level-triggered check on uninitialized data
authorStanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Thu, 7 May 2026 15:43:43 +0000 (15:43 +0000)
committerWei Liu <wei.liu@kernel.org>
Fri, 31 Jul 2026 20:01:57 +0000 (20:01 +0000)
commit0289a67cd70bf9d3807e289f4efd643e16a6c6b4
treedaf43615ac045b348f530e1f3486fdcb69c37842
parent0762262ac3e70f65b3bb843fe892f8bac1562d08
mshv: Fix level-triggered check on uninitialized data

In mshv_irqfd_assign(), the level-triggered validation for resample
irqfds checks irqfd_lapic_irq.lapic_control.level_triggered before
mshv_irqfd_update() has populated the field. Since the irqfd struct is
zero-allocated, level_triggered is always 0 at that point, causing the
check to always reject resample irqfds with -EINVAL. This makes
level-triggered interrupt resampling — used to avoid interrupt storms
with assigned devices — completely non-functional.

Move the check after the mshv_irqfd_update() call, which resolves the
IRQ routing entry and populates irqfd_lapic_irq with the actual trigger
mode.

Fixes: 621191d709b14 ("Drivers: hv: Introduce mshv_root module to expose /dev/mshv to VMMs")
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>
drivers/hv/mshv_eventfd.c