From bddd1a6ad91cacc34af773c8c913f205c3917847 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Fri, 2 Oct 2026 15:58:58 +0200 Subject: [PATCH] Xv: reject negative image size in QueryImageAttributes When ddQueryImageAttributes() overflows and returns a negative size, QueryImageAttributes would still reply with that value cast to CARD32, reporting a bogus data_size to the client. Reject negative sizes with BadValue. CVE-2026-109903 Reported-by: Tristan Madani Signed-off-by: Olivier Fourdan Assisted-by: AI Part-of: --- Xext/xvdisp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c index 55b25b4be0..1c889c2aad 100644 --- a/Xext/xvdisp.c +++ b/Xext/xvdisp.c @@ -1006,6 +1006,10 @@ ProcXvQueryImageAttributes(ClientPtr client) size = (*pPort->pAdaptor->ddQueryImageAttributes) (pPort, pImage, &width, &height, offsets, pitches); + if (size < 0) { + free(offsets); + return BadValue; + } rep = (xvQueryImageAttributesReply) { .type = X_Reply, -- GitLab