Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=90.155.50.34 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796049384; b=kYWmpWAdMnbpCuBy0GrmmxznlBaCQB2V2b6frz3UhdPnzFa9XTBucICpMSCPr4OqaTGU 2CmNDfuqumFfOLlr25VIbo7swTxFadc/aDIVdkEeaVHhaDaswK0erSp7lB02SSIojY0Ca u7OW36NmjWVhdSdfoi9RuUwITMAb0ogi7qLXKuaKX1klRSGNWDRtIEPMSf/tFFih4u/Vd AeRHmufMy7CLiZiPxLy7DZIfDGEyotlSZjOEG9fJ9yU/cSNsKp/V2BUVA3Mgk3U0CkEws ITzGZHfv3Fu5yQd8qJgr4FsyQzkUMw54aYxZOPvSckESwhNRE4k2rvFDRVBNZb5n/LA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796049384; h=DMARC-Filter:DKIM-Signature:Received:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:Sender:X-SRS-Rewrite; bh=gvgjY55IHWAJ7eIM91ucdn3ylrQp+1LTnS+Sc6EIjLI=; b=T5y+2Egj2Ek4gU95GDSCSnlVaXeJ57z9V5Qdp/Qe/WahVsBCivdKilafSAHj1Cm6zjxn 8fozVI92Gt/OUvjue6LZBLY+1KDWBaWdP12n0P9QQIs4CcNO+oQsLll2KBZ/F5sqKyn1d LGj/yJPKaLGqkUu4wIGCTrLAjefREGJH18s54/bIFPOkuw1+5xMNqdGXjRBX3aQzkP9F0 RPeJej4c/Qo9wMxLtqCZ09dlfVfXHyT7U8PK9wDKujl+1VWwTy6uttXo9hzlk8TwzTJd8 yl1Ufxaatlh9mjIm5KRzpENrZzQ4cwGC16aC4kJKzt3VEZVOkee3n2U9Z/6i/hLEJGA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=infradead.org; spf=none smtp.mailfrom=casper.srs.infradead.org; dkim=pass header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=Ef9+1By6; arc=none smtp.remote-ip=90.155.50.34 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5D2F9606A320 for ; Mon, 30 Nov 2026 14:36:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 5D2F9606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=casper.srs.infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.a=rsa-sha256 header.s=casper.20170209 header.b=Ef9+1By6 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Sender:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description; bh=gvgjY55IHWAJ7eIM91ucdn3ylrQp+1LTnS+Sc6EIjLI=; b=Ef9+1By6e+HQxPz3E1YL9vscOw 808UGXaofO9Jp7om1XNvTUBvvZOx2zPvDAmlB7PDELU3Anx7cL42IaGhSme5ZRU1YAEpNjjUWkqi5 7GFRtiiXryXes7FqUTbnIb0fY1tfdsJxZ8beO4ZTA6j7nrIM6XyPJLV3tdLGamiIzMKg7B23iJ2+U qnfApAlnKmC+QcUO04iDid9YMV6CRHeOxzinv+iLbmHW3Gn5mPYO4F6dJQ85u0NK4q0M1P8c52E81 PxH4NNtpajXpFOKmtyHu6bzO+KHgbUOISwZfnyEWGGEUzWRz2bj69mKbBLGRkN+qRde9dS33ILkhN 6qLidDUQ==; Received: from [2001:8b0:10b:1::425] (helo=i7.infradead.org) by casper.infradead.org with esmtpsa (Exim 4.100.1 #2 (Red Hat Linux)) id 1xY2UO-0000000EoJW-0MZH; Mon, 30 Nov 2026 14:36:20 +0000 Received: from dwoodhou by i7.infradead.org with local (Exim 4.99.5 #2 (Red Hat Linux)) id 1xY2UN-00000000v5E-3jpj; Mon, 30 Nov 2026 14:36:19 +0000 From: David Woodhouse To: qemu-devel@nongnu.org Cc: xen-devel@lists.xenproject.org, kvm@vger.kernel.org, Paolo Bonzini , Peter Maydell , Paul Durrant , Stefano Stabellini , Anthony PERARD , "Edgar E . Iglesias" , "Michael S . Tsirkin" , Richard Henderson , Marcelo Tosatti , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Jason Wang , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Hui Peng , Mark Syms , Feifan Qian , David Woodhouse Subject: [PULL 01/21] hw/xen: Fix partial request header handling in emulated XenStore Date: Mon, 30 Nov 2026 14:35:59 +0000 Message-ID: <20261130143619.219423-2-dwmw2@infradead.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20261130143619.219423-1-dwmw2@infradead.org> References: <20261130143619.219423-1-dwmw2@infradead.org> X-Mailing-List: kvm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: David Woodhouse X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html From: David Woodhouse 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 Signed-off-by: David Woodhouse --- 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