/[packages]/updates/8/x11-server/current/SOURCES/0005-Xext-free-the-screen-saver-resource-when-replacing-i.patch
ViewVC logotype

Contents of /updates/8/x11-server/current/SOURCES/0005-Xext-free-the-screen-saver-resource-when-replacing-i.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1932107 - (show annotations) (download)
Tue Jan 10 14:26:35 2023 UTC (4 months, 3 weeks ago) by ns80
File size: 1605 byte(s)
- add patches from Fedora for CVE-2022-4634[0-4] and CVE-2022-4283 (mga#31281)

1 From 94f6fe99d87cf6ba0adadd95c595158c345b7d29 Mon Sep 17 00:00:00 2001
2 From: Peter Hutterer <peter.hutterer@who-t.net>
3 Date: Tue, 29 Nov 2022 14:53:07 +1000
4 Subject: [PATCH xserver 5/7] Xext: free the screen saver resource when
5 replacing it
6
7 This fixes a use-after-free bug:
8
9 When a client first calls ScreenSaverSetAttributes(), a struct
10 ScreenSaverAttrRec is allocated and added to the client's
11 resources.
12
13 When the same client calls ScreenSaverSetAttributes() again, a new
14 struct ScreenSaverAttrRec is allocated, replacing the old struct. The
15 old struct was freed but not removed from the clients resources.
16
17 Later, when the client is destroyed the resource system invokes
18 ScreenSaverFreeAttr and attempts to clean up the already freed struct.
19
20 Fix this by letting the resource system free the old attrs instead.
21
22 CVE-2022-46343, ZDI-CAN 19404
23
24 This vulnerability was discovered by:
25 Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
26
27 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
28 Acked-by: Olivier Fourdan <ofourdan@redhat.com>
29 ---
30 Xext/saver.c | 2 +-
31 1 file changed, 1 insertion(+), 1 deletion(-)
32
33 diff --git a/Xext/saver.c b/Xext/saver.c
34 index f813ba08d1..fd6153c313 100644
35 --- a/Xext/saver.c
36 +++ b/Xext/saver.c
37 @@ -1051,7 +1051,7 @@ ScreenSaverSetAttributes(ClientPtr client)
38 pVlist++;
39 }
40 if (pPriv->attr)
41 - FreeScreenAttr(pPriv->attr);
42 + FreeResource(pPriv->attr->resource, AttrType);
43 pPriv->attr = pAttr;
44 pAttr->resource = FakeClientID(client->index);
45 if (!AddResource(pAttr->resource, AttrType, (void *) pAttr))
46 --
47 2.38.1
48

  ViewVC Help
Powered by ViewVC 1.1.28