From a659519ffa3eae4c94218b03e704a2b6d26adf6f Mon Sep 17 00:00:00 2001 From: Olivier Fourdan Date: Wed, 18 Jun 2025 08:39:02 +0200 Subject: [PATCH] os: Check for integer overflow on BigRequest length Check for another possible integer overflow once we get a complete xReq with BigRequest. Related to CVE-2025-49176 Signed-off-by: Olivier Fourdan Suggested-by: Peter Harris (cherry picked from commit 4fc4d76b2c7aaed61ed2653f997783a3714c4fe1) Part-of: --- os/io.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/os/io.c b/os/io.c index 26f9161ef..83986af92 100644 --- a/os/io.c +++ b/os/io.c @@ -395,6 +395,8 @@ ReadRequestFromClient(ClientPtr client) needed = get_big_req_len(request, client); } client->req_len = needed; + if (needed > MAXINT >> 2) + return -(BadLength); needed <<= 2; } if (gotnow < needed) {