libx11: fix CVE-2022-3555 memory leak in _XFreeX11XCBStructure() of xcb_disp.c

(From OE-Core rev: f17a61d12ceb5be203e1a1af9125bb61673a8b41)

Signed-off-by: Vivek Kumbhar <vkumbhar@mvista.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Vivek Kumbhar
2022-12-23 12:40:23 +05:30
committed by Richard Purdie
parent 0a61076d20
commit f5b71296f7
2 changed files with 39 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
From 8a368d808fec166b5fb3dfe6312aab22c7ee20af Mon Sep 17 00:00:00 2001
From: Hodong <hodong@yozmos.com>
Date: Thu, 20 Jan 2022 00:57:41 +0900
Subject: [PATCH] Fix two memory leaks in _XFreeX11XCBStructure()
Even when XCloseDisplay() was called, some memory was leaked.
XCloseDisplay() calls _XFreeDisplayStructure(), which calls
_XFreeX11XCBStructure().
However, _XFreeX11XCBStructure() did not destroy the condition variables,
resulting in the leaking of some 40 bytes.
Signed-off-by: Hodong <hodong@yozmos.com>
Upstream-Status: Backport from [https://gitlab.freedesktop.org/xorg/lib/libx11/-/commit/8a368d808fec166b5fb3dfe6312aab22c7ee20af]
CVE:CVE-2022-3555
Signed-off-by: Vivek Kumbhar <vkumbhar@mvista.com>
---
src/xcb_disp.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/xcb_disp.c b/src/xcb_disp.c
index 70a602f4..e9becee3 100644
--- a/src/xcb_disp.c
+++ b/src/xcb_disp.c
@@ -102,6 +102,8 @@ void _XFreeX11XCBStructure(Display *dpy)
dpy->xcb->pending_requests = tmp->next;
free(tmp);
}
+ xcondition_clear(dpy->xcb->event_notify);
+ xcondition_clear(dpy->xcb->reply_notify);
xcondition_free(dpy->xcb->event_notify);
xcondition_free(dpy->xcb->reply_notify);
Xfree(dpy->xcb);
--
2.18.2

View File

@@ -17,6 +17,7 @@ SRC_URI += "file://Fix-hanging-issue-in-_XReply.patch \
file://CVE-2020-14363.patch \
file://CVE-2021-31535.patch \
file://CVE-2022-3554.patch \
file://CVE-2022-3555.patch \
"
SRC_URI[md5sum] = "55adbfb6d4370ecac5e70598c4e7eed2"