wok-current view xorg-server/stuff/CVE-2022-46344.patch @ rev 25634
Mass update, new toolchain gcc 8.3.0, glibc 2.28.0
author | Stanislas Leduc <shann@slitaz.org> |
---|---|
date | Sun Jan 14 08:12:37 2024 +0000 (20 months ago) |
parents | |
children |
line source
1 From 8f454b793e1f13c99872c15f0eed1d7f3b823fe8 Mon Sep 17 00:00:00 2001
2 From: Peter Hutterer <peter.hutterer@who-t.net>
3 Date: Tue, 29 Nov 2022 13:26:57 +1000
4 Subject: [PATCH] Xi: avoid integer truncation in length check of
5 ProcXIChangeProperty
7 This fixes an OOB read and the resulting information disclosure.
9 Length calculation for the request was clipped to a 32-bit integer. With
10 the correct stuff->num_items value the expected request size was
11 truncated, passing the REQUEST_FIXED_SIZE check.
13 The server then proceeded with reading at least stuff->num_items bytes
14 (depending on stuff->format) from the request and stuffing whatever it
15 finds into the property. In the process it would also allocate at least
16 stuff->num_items bytes, i.e. 4GB.
18 The same bug exists in ProcChangeProperty and ProcXChangeDeviceProperty,
19 so let's fix that too.
21 CVE-2022-46344, ZDI-CAN 19405
23 This vulnerability was discovered by:
24 Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
26 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
27 Acked-by: Olivier Fourdan <ofourdan@redhat.com>
28 ---
29 Xi/xiproperty.c | 4 ++--
30 dix/property.c | 3 ++-
31 2 files changed, 4 insertions(+), 3 deletions(-)
33 diff --git a/Xi/xiproperty.c b/Xi/xiproperty.c
34 index 68c362c62..066ba21fb 100644
35 --- a/Xi/xiproperty.c
36 +++ b/Xi/xiproperty.c
37 @@ -890,7 +890,7 @@ ProcXChangeDeviceProperty(ClientPtr client)
38 REQUEST(xChangeDevicePropertyReq);
39 DeviceIntPtr dev;
40 unsigned long len;
41 - int totalSize;
42 + uint64_t totalSize;
43 int rc;
45 REQUEST_AT_LEAST_SIZE(xChangeDevicePropertyReq);
46 @@ -1130,7 +1130,7 @@ ProcXIChangeProperty(ClientPtr client)
47 {
48 int rc;
49 DeviceIntPtr dev;
50 - int totalSize;
51 + uint64_t totalSize;
52 unsigned long len;
54 REQUEST(xXIChangePropertyReq);
55 diff --git a/dix/property.c b/dix/property.c
56 index 94ef5a0ec..acce94b2c 100644
57 --- a/dix/property.c
58 +++ b/dix/property.c
59 @@ -205,7 +205,8 @@ ProcChangeProperty(ClientPtr client)
60 WindowPtr pWin;
61 char format, mode;
62 unsigned long len;
63 - int sizeInBytes, totalSize, err;
64 + int sizeInBytes, err;
65 + uint64_t totalSize;
67 REQUEST(xChangePropertyReq);
69 --
70 GitLab