|
|
7984e5 |
From 3eb5445f6f7fa9f86de87adc768105d42bdbcf74 Mon Sep 17 00:00:00 2001
|
|
|
7984e5 |
From: Povilas Kanapickas <povilas@radix.lt>
|
|
|
7984e5 |
Date: Tue, 14 Dec 2021 15:00:01 +0200
|
|
|
7984e5 |
Subject: [PATCH xserver 2/4] xfixes: Fix out of bounds access in
|
|
|
7984e5 |
*ProcXFixesCreatePointerBarrier()
|
|
|
7984e5 |
|
|
|
7984e5 |
ZDI-CAN-14950, CVE-2021-4009
|
|
|
7984e5 |
|
|
|
7984e5 |
This vulnerability was discovered and the fix was suggested by:
|
|
|
7984e5 |
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
|
|
|
7984e5 |
|
|
|
7984e5 |
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
|
|
|
7984e5 |
(cherry picked from commit b5196750099ae6ae582e1f46bd0a6dad29550e02)
|
|
|
7984e5 |
---
|
|
|
7984e5 |
xfixes/cursor.c | 6 ++++--
|
|
|
7984e5 |
1 file changed, 4 insertions(+), 2 deletions(-)
|
|
|
7984e5 |
|
|
|
7984e5 |
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
|
|
|
7984e5 |
index 60580b88f..c5d4554b2 100644
|
|
|
7984e5 |
--- a/xfixes/cursor.c
|
|
|
7984e5 |
+++ b/xfixes/cursor.c
|
|
|
7984e5 |
@@ -1010,7 +1010,8 @@ ProcXFixesCreatePointerBarrier(ClientPtr client)
|
|
|
7984e5 |
{
|
|
|
7984e5 |
REQUEST(xXFixesCreatePointerBarrierReq);
|
|
|
7984e5 |
|
|
|
7984e5 |
- REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq, pad_to_int32(stuff->num_devices));
|
|
|
7984e5 |
+ REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq,
|
|
|
7984e5 |
+ pad_to_int32(stuff->num_devices * sizeof(CARD16)));
|
|
|
7984e5 |
LEGAL_NEW_RESOURCE(stuff->barrier, client);
|
|
|
7984e5 |
|
|
|
7984e5 |
return XICreatePointerBarrier(client, stuff);
|
|
|
7984e5 |
@@ -1027,7 +1028,8 @@ SProcXFixesCreatePointerBarrier(ClientPtr client)
|
|
|
7984e5 |
|
|
|
7984e5 |
swaps(&stuff->length);
|
|
|
7984e5 |
swaps(&stuff->num_devices);
|
|
|
7984e5 |
- REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq, pad_to_int32(stuff->num_devices));
|
|
|
7984e5 |
+ REQUEST_FIXED_SIZE(xXFixesCreatePointerBarrierReq,
|
|
|
7984e5 |
+ pad_to_int32(stuff->num_devices * sizeof(CARD16)));
|
|
|
7984e5 |
|
|
|
7984e5 |
swapl(&stuff->barrier);
|
|
|
7984e5 |
swapl(&stuff->window);
|
|
|
7984e5 |
--
|
|
|
7984e5 |
2.33.1
|
|
|
7984e5 |
|