CVE-2023-0494: potential use-after-free

This commit is contained in:
Peter Hutterer 2023-02-02 15:32:24 +10:00
parent 50af4f1fc6
commit 996eaa843f
2 changed files with 41 additions and 1 deletions

View File

@ -0,0 +1,35 @@
From 7150ba655c0cc08fa6ded309b81265bb672f2869 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
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 <peter.hutterer@who-t.net>
---
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

View File

@ -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 <peter.hutterer@redhat.com> - 1.20.14-18
- CVE-2023-0494: potential use-after-free
* Wed Feb 01 2023 Peter Hutterer <peter.hutterer@redhat.com> - 1.20.14-17
- Updated conditional fedora statement