Re: [PATCH v3 06/13] KVM: x86/xen: Enforce 4-byte alignment of vcpu_info registration
From: Paul Durrant
Date: Wed Sep 02 2026 - 08:40:12 EST
On 31/08/2026 22:26, David Woodhouse wrote:
From: David Woodhouse <dwmw@xxxxxxxxxxxx>Reviewed-by: Paul Durrant <paul@xxxxxxx>
Xen's map_guest_area() enforces that vcpu_info is aligned to
sizeof(xen_ulong_t). KVM has no such check, allowing a guest to
register vcpu_info at an arbitrary byte alignment.
Enforce unconditional 4-byte alignment regardless of the current
shinfo mode. This is sufficient because subsequent commits ensure
that all locked atomic operations on vcpu_info fields use at most
32-bit accesses. Return -ENXIO on failure, matching Xen's
map_guest_area() behaviour for unaligned requests.
Originally observed in review of an unrelated patch:
https://lore.kernel.org/all/20260604193554.1BA311F00893@xxxxxxxxxxxxxxx/
Cc: stable@xxxxxxxxxxxxxxx
Fixes: 73e69a86347a ("KVM: x86/xen: register vcpu info")
Reported-by: sashiko-bot@xxxxxxxxxx
Closes: https://lore.kernel.org/all/20260604193554.1BA311F00893@xxxxxxxxxxxxxxx
Assisted-by: Kiro:claude-opus-4.6-1m
Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
---
arch/x86/kvm/xen.c | 8 ++++++++
1 file changed, 8 insertions(+)