summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorSona Sarmadi <sona.sarmadi@enea.com>2017-01-27 08:26:12 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-02-08 12:00:21 +0000
commitb45822fe666784c6588317e2cd1e0c411e564197 (patch)
tree2301ad8a0ef9022ce9ef15e8c99e7f9601724884 /meta
parent7cf454e23cdead13dd0041b626045e19d4889bf5 (diff)
downloadpoky-b45822fe666784c6588317e2cd1e0c411e564197.tar.gz
libxrender: CVE-2016-7949
Insufficient validation of server responses results in overflow of previously reserved memory Upstream patch: https://cgit.freedesktop.org/xorg/lib/libXrender/commit/?id=9362c7ddd1af3b168953d0737877bc52d79c94f4 External References: https://lists.x.org/archives/xorg-announce/2016-October/002720.html https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2016-7949 (From OE-Core rev: 87ffd7ce2e8ece8b44ff3f1c219a74b3590cf14b) Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-graphics/xorg-lib/libxrender/CVE-2016-7949.patch59
-rw-r--r--meta/recipes-graphics/xorg-lib/libxrender_0.9.9.bb3
2 files changed, 62 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xorg-lib/libxrender/CVE-2016-7949.patch b/meta/recipes-graphics/xorg-lib/libxrender/CVE-2016-7949.patch
new file mode 100644
index 0000000000..73315b1084
--- /dev/null
+++ b/meta/recipes-graphics/xorg-lib/libxrender/CVE-2016-7949.patch
@@ -0,0 +1,59 @@
1From 9362c7ddd1af3b168953d0737877bc52d79c94f4 Mon Sep 17 00:00:00 2001
2From: Tobias Stoeckmann <tobias@stoeckmann.org>
3Date: Sun, 25 Sep 2016 21:43:09 +0200
4Subject: Validate lengths while parsing server data.
5
6Individual lengths inside received server data can overflow
7the previously reserved memory.
8
9It is therefore important to validate every single length
10field to not overflow the previously agreed sum of all invidual
11length fields.
12
13v2: consume remaining bytes in the reply buffer on error.
14
15CVE: CVE-2016-7949
16Upstream-Status: Backport
17
18Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
19Reviewed-by: Matthieu Herrb@laas.fr
20Signed-off-by: Sona Sarmadi <sona.sarmadi@enea.com>
21
22diff --git a/src/Xrender.c b/src/Xrender.c
23index 3102eb2..71cf3e6 100644
24--- a/src/Xrender.c
25+++ b/src/Xrender.c
26@@ -533,12 +533,30 @@ XRenderQueryFormats (Display *dpy)
27 screen->fallback = _XRenderFindFormat (xri, xScreen->fallback);
28 screen->subpixel = SubPixelUnknown;
29 xDepth = (xPictDepth *) (xScreen + 1);
30+ if (screen->ndepths > rep.numDepths) {
31+ Xfree (xri);
32+ Xfree (xData);
33+ _XEatDataWords (dpy, rep.length);
34+ UnlockDisplay (dpy);
35+ SyncHandle ();
36+ return 0;
37+ }
38+ rep.numDepths -= screen->ndepths;
39 for (nd = 0; nd < screen->ndepths; nd++)
40 {
41 depth->depth = xDepth->depth;
42 depth->nvisuals = xDepth->nPictVisuals;
43 depth->visuals = visual;
44 xVisual = (xPictVisual *) (xDepth + 1);
45+ if (depth->nvisuals > rep.numVisuals) {
46+ Xfree (xri);
47+ Xfree (xData);
48+ _XEatDataWords (dpy, rep.length);
49+ UnlockDisplay (dpy);
50+ SyncHandle ();
51+ return 0;
52+ }
53+ rep.numVisuals -= depth->nvisuals;
54 for (nv = 0; nv < depth->nvisuals; nv++)
55 {
56 visual->visual = _XRenderFindVisual (dpy, xVisual->visual);
57--
58cgit v0.10.2
59
diff --git a/meta/recipes-graphics/xorg-lib/libxrender_0.9.9.bb b/meta/recipes-graphics/xorg-lib/libxrender_0.9.9.bb
index 44cb2e0ebb..eac367906c 100644
--- a/meta/recipes-graphics/xorg-lib/libxrender_0.9.9.bb
+++ b/meta/recipes-graphics/xorg-lib/libxrender_0.9.9.bb
@@ -19,5 +19,8 @@ XORG_PN = "libXrender"
19 19
20BBCLASSEXTEND = "native nativesdk" 20BBCLASSEXTEND = "native nativesdk"
21 21
22SRC_URI += "file://CVE-2016-7949.patch \
23 "
24
22SRC_URI[md5sum] = "5db92962b124ca3a8147daae4adbd622" 25SRC_URI[md5sum] = "5db92962b124ca3a8147daae4adbd622"
23SRC_URI[sha256sum] = "fc2fe57980a14092426dffcd1f2d9de0987b9d40adea663bd70d6342c0e9be1a" 26SRC_URI[sha256sum] = "fc2fe57980a14092426dffcd1f2d9de0987b9d40adea663bd70d6342c0e9be1a"