From 43b4064af332fdd8cfc52709b7b584724a68401d Mon Sep 17 00:00:00 2001 From: Acts1631 Date: Tue, 21 Jul 2026 11:32:24 -0400 Subject: [PATCH] XTest: validate valuator range before writing XTestFakeInput copied device valuators into a fixed stack array before checking whether the record fit in the target device axis range. A high-axis device and crafted request could write past the array. Validate the count and range before indexing the stack array. CVE-2026-109093 Part-of: --- Xext/xtest.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Xext/xtest.c b/Xext/xtest.c index 2b56bdcc52..4e5d1d9c59 100644 --- a/Xext/xtest.c +++ b/Xext/xtest.c @@ -287,6 +287,12 @@ ProcXTestFakeInput(ClientPtr client) client->errorValue = dv->first_valuator; return BadValue; } + if (!dv->num_valuators || dv->num_valuators > 6 || + base + dv->num_valuators > dev->valuator->numAxes || + base + dv->num_valuators > MAX_VALUATORS) { + client->errorValue = dv->num_valuators; + return BadValue; + } switch (dv->num_valuators) { case 6: valuators[base + 5] = dv->valuator5; @@ -313,11 +319,6 @@ ProcXTestFakeInput(ClientPtr client) base += dv->num_valuators; numValuators += dv->num_valuators; - - if (firstValuator + numValuators > dev->valuator->numAxes) { - client->errorValue = dv->num_valuators; - return BadValue; - } } type = type - XI_DeviceKeyPress + KeyPress; -- GitLab