From 59bef99381b33c3a3d21fe6835d2aaf28d1597b0 Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Fri, 2 Oct 2026 15:58:45 +0200 Subject: [PATCH] Xv: reject negative image size in PutImage ddQueryImageAttributes() can return a negative size when the adaptor overflows during size calculation. Adding that value to the request header size can make the length check accept a request that does not contain the claimed image data. Reject negative sizes before validating the request length. CVE-2026-109096 Reported-by: Tristan Madani Signed-off-by: Olivier Fourdan Assisted-by: AI Part-of: --- Xext/xvdisp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c index 84e6be1dfb..55b25b4be0 100644 --- a/Xext/xvdisp.c +++ b/Xext/xvdisp.c @@ -853,6 +853,9 @@ ProcXvPutImage(ClientPtr client) height = stuff->height; size = (*pPort->pAdaptor->ddQueryImageAttributes) (pPort, pImage, &width, &height, NULL, NULL); + if (size < 0) + return BadValue; + size += sizeof(xvPutImageReq); size = bytes_to_int32(size); -- GitLab