From 996eaa843f218b2e237334460c31ac4c2d221f53 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 2 Feb 2023 15:32:24 +1000 Subject: [PATCH] CVE-2023-0494: potential use-after-free --- ...-use-after-free-in-DeepCopyPointerCl.patch | 35 +++++++++++++++++++ xorg-x11-server.spec | 7 +++- 2 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 0001-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch diff --git a/0001-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch b/0001-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch new file mode 100644 index 0000000..2389895 --- /dev/null +++ b/0001-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 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index c689d4e..0c2a07e 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -46,7 +46,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.20.14 -Release: 17%{?gitdate:.%{gitdate}}%{?dist} +Release: 18%{?gitdate:.%{gitdate}}%{?dist} URL: http://www.x.org License: MIT @@ -133,6 +133,8 @@ Patch120: 0006-Xext-free-the-XvRTVideoNotify-when-turning-off-from-.patch Patch121: 0007-xkb-reset-the-radio_groups-pointer-to-NULL-after-fre.patch # Fix for buggy patch to CVE-2022-46340 Patch122: 0008-Xext-fix-invalid-event-type-mask-in-XTestSwapFakeInp.patch +# CVE-2023-0494 +Patch123: 0001-Xi-fix-potential-use-after-free-in-DeepCopyPointerCl.patch # Only on F38 and later (patch number starts at 3801, see autopatch below) # Upstream commits 73d6e88, f69280dd and 4127776, minus the xwayland.pc.in change @@ -552,6 +554,9 @@ find %{inst_srcdir}/hw/xfree86 -name \*.c -delete %changelog +* Thu Feb 02 2023 Peter Hutterer - 1.20.14-18 +- CVE-2023-0494: potential use-after-free + * Wed Feb 01 2023 Peter Hutterer - 1.20.14-17 - Updated conditional fedora statement