[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PULL 01/21] hw/xen: Fix partial request header handling in emulated XenStore



From: David Woodhouse <dwmw@xxxxxxxxxxxx>

When a XenStore request header is only partially received, QEMU copies
XENSTORE_HEADER_SIZE bytes instead of only the remaining header bytes.

Fix the length calculation to copy only the missing part of the header.

Resolves: https://gitlab.com/qemu-project/qemu/-/work_items/3644
Fixes: f3341e7b915 ("hw/xen: Add basic ring handling to xenstore")
Fixes: CVE-2026-61403
Reviewed-by: Paul Durrant <paul@xxxxxxx>
Signed-off-by: David Woodhouse <dwmw@xxxxxxxxxxxx>
---
 hw/i386/kvm/xen_xenstore.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/i386/kvm/xen_xenstore.c b/hw/i386/kvm/xen_xenstore.c
index 0dc0edf3bf..7d6d6d5cbb 100644
--- a/hw/i386/kvm/xen_xenstore.c
+++ b/hw/i386/kvm/xen_xenstore.c
@@ -1218,7 +1218,7 @@ static unsigned int get_req(XenXenstoreState *s)
 
     if (s->req_offset < XENSTORE_HEADER_SIZE) {
         void *ptr = s->req_data + s->req_offset;
-        unsigned int len = XENSTORE_HEADER_SIZE;
+        unsigned int len = XENSTORE_HEADER_SIZE - s->req_offset;
         unsigned int copylen = copy_from_ring(s, ptr, len);
 
         copied += copylen;
-- 
2.55.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.