diff options
author | Li Zhou <li.zhou@windriver.com> | 2015-04-23 17:20:06 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-04-28 07:56:56 +0100 |
commit | 1abe1160dacdf892f1379cdd8b1884077611498d (patch) | |
tree | 59577cb06eb16f2b25e0390da93ffb537bc0aaa4 /meta/recipes-graphics | |
parent | d812d32ee64430c60d354f1482642e49a207b871 (diff) | |
download | poky-1abe1160dacdf892f1379cdd8b1884077611498d.tar.gz |
libxfont: Security Advisory - libxfont - CVE-2015-1802
bdfReadProperties: property count needs range check
Avoid integer overflow or underflow when allocating memory arrays
by multiplying the number of properties reported for a BDF font.
(From OE-Core rev: 0ff9f2bf0e44a7b47a98234a12714c780825e286)
Signed-off-by: Li Zhou <li.zhou@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics')
-rw-r--r-- | meta/recipes-graphics/xorg-lib/libxfont/0001-bdfReadProperties-property-count-needs-range-check-C.patch | 38 | ||||
-rw-r--r-- | meta/recipes-graphics/xorg-lib/libxfont_1.5.0.bb | 3 |
2 files changed, 41 insertions, 0 deletions
diff --git a/meta/recipes-graphics/xorg-lib/libxfont/0001-bdfReadProperties-property-count-needs-range-check-C.patch b/meta/recipes-graphics/xorg-lib/libxfont/0001-bdfReadProperties-property-count-needs-range-check-C.patch new file mode 100644 index 0000000000..0779c26dcd --- /dev/null +++ b/meta/recipes-graphics/xorg-lib/libxfont/0001-bdfReadProperties-property-count-needs-range-check-C.patch | |||
@@ -0,0 +1,38 @@ | |||
1 | From 2deda9906480f9c8ae07b8c2a5510cc7e4c59a8e Mon Sep 17 00:00:00 2001 | ||
2 | From: Alan Coopersmith <alan.coopersmith@oracle.com> | ||
3 | Date: Fri, 6 Feb 2015 15:50:45 -0800 | ||
4 | Subject: [PATCH] bdfReadProperties: property count needs range check | ||
5 | [CVE-2015-1802] | ||
6 | |||
7 | Avoid integer overflow or underflow when allocating memory arrays | ||
8 | by multiplying the number of properties reported for a BDF font. | ||
9 | |||
10 | Reported-by: Ilja Van Sprundel <ivansprundel@ioactive.com> | ||
11 | Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> | ||
12 | Reviewed-by: Julien Cristau <jcristau@debian.org> | ||
13 | |||
14 | Upstream-Status: backport | ||
15 | |||
16 | Signed-off-by: Li Zhou <li.zhou@windriver.com> | ||
17 | --- | ||
18 | src/bitmap/bdfread.c | 4 +++- | ||
19 | 1 file changed, 3 insertions(+), 1 deletion(-) | ||
20 | |||
21 | diff --git a/src/bitmap/bdfread.c b/src/bitmap/bdfread.c | ||
22 | index 914a024..6387908 100644 | ||
23 | --- a/src/bitmap/bdfread.c | ||
24 | +++ b/src/bitmap/bdfread.c | ||
25 | @@ -604,7 +604,9 @@ bdfReadProperties(FontFilePtr file, FontPtr pFont, bdfFileState *pState) | ||
26 | bdfError("missing 'STARTPROPERTIES'\n"); | ||
27 | return (FALSE); | ||
28 | } | ||
29 | - if (sscanf((char *) line, "STARTPROPERTIES %d", &nProps) != 1) { | ||
30 | + if ((sscanf((char *) line, "STARTPROPERTIES %d", &nProps) != 1) || | ||
31 | + (nProps <= 0) || | ||
32 | + (nProps > ((INT32_MAX / sizeof(FontPropRec)) - BDF_GENPROPS))) { | ||
33 | bdfError("bad 'STARTPROPERTIES'\n"); | ||
34 | return (FALSE); | ||
35 | } | ||
36 | -- | ||
37 | 1.7.9.5 | ||
38 | |||
diff --git a/meta/recipes-graphics/xorg-lib/libxfont_1.5.0.bb b/meta/recipes-graphics/xorg-lib/libxfont_1.5.0.bb index ef0bde29fb..4a3c9b7db7 100644 --- a/meta/recipes-graphics/xorg-lib/libxfont_1.5.0.bb +++ b/meta/recipes-graphics/xorg-lib/libxfont_1.5.0.bb | |||
@@ -18,5 +18,8 @@ XORG_PN = "libXfont" | |||
18 | 18 | ||
19 | BBCLASSEXTEND = "native" | 19 | BBCLASSEXTEND = "native" |
20 | 20 | ||
21 | SRC_URI += "file://0001-bdfReadProperties-property-count-needs-range-check-C.patch \ | ||
22 | " | ||
23 | |||
21 | SRC_URI[md5sum] = "664629bfa7cdf8b984155019fd395dcb" | 24 | SRC_URI[md5sum] = "664629bfa7cdf8b984155019fd395dcb" |
22 | SRC_URI[sha256sum] = "3a3c52c4adf9352b2160f07ff0596af17ab14f91d6509564e606678a1261c25f" | 25 | SRC_URI[sha256sum] = "3a3c52c4adf9352b2160f07ff0596af17ab14f91d6509564e606678a1261c25f" |