Blame SOURCES/0007-xkb-reset-the-radio_groups-pointer-to-NULL-after-fre.patch

290b8e
From 774260dbae1fa505cd2848c786baed9a8db5179d Mon Sep 17 00:00:00 2001
290b8e
From: Peter Hutterer <peter.hutterer@who-t.net>
290b8e
Date: Mon, 5 Dec 2022 15:55:54 +1000
290b8e
Subject: [PATCH xserver 7/7] xkb: reset the radio_groups pointer to NULL after
290b8e
 freeing it
290b8e
290b8e
Unlike other elements of the keymap, this pointer was freed but not
290b8e
reset. On a subsequent XkbGetKbdByName request, the server may access
290b8e
already freed memory.
290b8e
290b8e
CVE-2022-46283, ZDI-CAN-19530
290b8e
290b8e
This vulnerability was discovered by:
290b8e
Jan-Niklas Sohn working with Trend Micro Zero Day Initiative
290b8e
290b8e
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
290b8e
Acked-by: Olivier Fourdan <ofourdan@redhat.com>
290b8e
---
290b8e
 xkb/xkbUtils.c | 1 +
290b8e
 1 file changed, 1 insertion(+)
290b8e
290b8e
diff --git a/xkb/xkbUtils.c b/xkb/xkbUtils.c
290b8e
index dd089c2046..3f5791a183 100644
290b8e
--- a/xkb/xkbUtils.c
290b8e
+++ b/xkb/xkbUtils.c
290b8e
@@ -1326,6 +1326,7 @@ _XkbCopyNames(XkbDescPtr src, XkbDescPtr dst)
290b8e
         }
290b8e
         else {
290b8e
             free(dst->names->radio_groups);
290b8e
+            dst->names->radio_groups = NULL;
290b8e
         }
290b8e
         dst->names->num_rg = src->names->num_rg;
290b8e
290b8e
--
290b8e
2.38.1