From 71cba5e407b22241b9078b61350a5f6631d2c59b Mon Sep 17 00:00:00 2001 From: Acts1631 Date: Tue, 21 Jul 2026 10:57:50 -0400 Subject: [PATCH] Xv: prevent overflow in shared-memory bounds check A crafted XvShmPutImage offset could wrap the image-size addition before range validation and pass an invalid source pointer to the DDX. Reject negative image sizes and validate the offset and required range with subtraction before deriving the source pointer. CVE-2026-109092 Part-of: --- Xext/xvdisp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Xext/xvdisp.c b/Xext/xvdisp.c index 41d511553b..84e6be1dfb 100644 --- a/Xext/xvdisp.c +++ b/Xext/xvdisp.c @@ -919,7 +919,8 @@ ProcXvShmPutImage(ClientPtr client) size_needed = (*pPort->pAdaptor->ddQueryImageAttributes) (pPort, pImage, &width, &height, NULL, NULL); - if ((size_needed + stuff->offset) > shmdesc->size) + if (size_needed < 0 || stuff->offset > shmdesc->size || + (unsigned long) size_needed > shmdesc->size - stuff->offset) return BadAccess; if ((width < stuff->width) || (height < stuff->height)) -- GitLab