From 197138efeb1eff6e3e188f7abf3213b1eff58804 Mon Sep 17 00:00:00 2001 From: Jan Grulich Date: Mon, 6 Feb 2023 12:53:31 +0100 Subject: [PATCH] xorg-x11-server: DeepCopyPointerClasses use-after-free leads to privilege elevation Resolves: bz#2167061 --- ...-use-after-free-in-DeepCopyPointerCl.patch | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 xorg-x11-server-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch diff --git a/xorg-x11-server-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch b/xorg-x11-server-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch new file mode 100644 index 0000000..2389895 --- /dev/null +++ b/xorg-x11-server-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch @@ -0,0 +1,35 @@ +From 7150ba655c0cc08fa6ded309b81265bb672f2869 Mon Sep 17 00:00:00 2001 +From: Peter Hutterer +Date: Wed, 25 Jan 2023 11:41:40 +1000 +Subject: [PATCH xserver] Xi: fix potential use-after-free in + DeepCopyPointerClasses + +CVE-2023-0494, ZDI-CAN 19596 + +This vulnerability was discovered by: +Jan-Niklas Sohn working with Trend Micro Zero Day Initiative + +Signed-off-by: Peter Hutterer +--- + Xi/exevents.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/Xi/exevents.c b/Xi/exevents.c +index 217baa9561..dcd4efb3bc 100644 +--- a/Xi/exevents.c ++++ b/Xi/exevents.c +@@ -619,8 +619,10 @@ DeepCopyPointerClasses(DeviceIntPtr from, DeviceIntPtr to) + memcpy(to->button->xkb_acts, from->button->xkb_acts, + sizeof(XkbAction)); + } +- else ++ else { + free(to->button->xkb_acts); ++ to->button->xkb_acts = NULL; ++ } + + memcpy(to->button->labels, from->button->labels, + from->button->numButtons * sizeof(Atom)); +-- +2.39.0 +