summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi Wang <li.wang@windriver.com>2013-01-07 11:10:00 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-01-07 11:32:14 (GMT)
commitabc622145cf05c3115bad8cf1fbc64a621b72df4 (patch)
treedf8eb7c36c3df7a59ec3413962f20a2e9dc60406
parentac932b4a7c8f67ac3a3eb75e2f5bda0f8124dd7d (diff)
downloadpoky-abc622145cf05c3115bad8cf1fbc64a621b72df4.tar.gz
cups - CVE-2011-2896
the patch come from: http://cups.org/strfiles/3867/str3867.patch The LZW decompressor in the LWZReadByte function in giftoppm.c in the David Koblas GIF decoder in PBMPLUS, as used in the gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, the LZWReadByte function in plug-ins/common/file-gif-load.c in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, does not properly handle code words that are absent from the decompression table when encountered, which allows remote attackers to trigger an infinite loop or a heap-based buffer overflow, and possibly execute arbitrary code, via a crafted compressed stream, a related issue to CVE-2006-1168 and CVE-2011-2895. http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-2896 [YOCTO #3582] [ CQID: WIND00299595 ] Upstream-Status: Backport (From OE-Core rev: 0742b7aecaada435f90f39f26914906a5eb1fd4f) (From OE-Core rev: 1518fc8febbe99fc7ce9b86e087f8bb1c02552d8) Signed-off-by: Li Wang <li.wang@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/cups/cups-1.4.6/cups-CVE-2011-2896.patch140
-rw-r--r--meta/recipes-extended/cups/cups_1.4.6.bb3
2 files changed, 142 insertions, 1 deletions
diff --git a/meta/recipes-extended/cups/cups-1.4.6/cups-CVE-2011-2896.patch b/meta/recipes-extended/cups/cups-1.4.6/cups-CVE-2011-2896.patch
new file mode 100644
index 0000000..7c6f75b
--- /dev/null
+++ b/meta/recipes-extended/cups/cups-1.4.6/cups-CVE-2011-2896.patch
@@ -0,0 +1,140 @@
1cups - CVE-2011-2896
2
3the patch come from:
4http://cups.org/strfiles/3867/str3867.patch
5
6The LZW decompressor in the LWZReadByte function in giftoppm.c
7in the David Koblas GIF decoder in PBMPLUS, as used in the
8gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7,
9the LZWReadByte function in plug-ins/common/file-gif-load.c
10in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c
11in XPCE in SWI-Prolog 5.10.4 and earlier, and other products,
12does not properly handle code words that are absent from the
13decompression table when encountered, which allows remote attackers to
14trigger an infinite loop or a heap-based buffer overflow, and possibly
15execute arbitrary code, via a crafted compressed stream, a related
16issue to CVE-2006-1168 and CVE-2011-2895.
17http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-2896
18
19Integrated-by: Li Wang <li.wang@windriver.com>
20---
21 filter/image-gif.c | 46 ++++++++++++++++++++--------------------------
22 1 files changed, 20 insertions(+), 26 deletions(-)
23
24diff --git a/filter/image-gif.c b/filter/image-gif.c
25index 3857c21..fa9691e 100644
26--- a/filter/image-gif.c
27+++ b/filter/image-gif.c
28@@ -353,7 +353,7 @@ gif_get_code(FILE *fp, /* I - File to read from */
29 * Read in another buffer...
30 */
31
32- if ((count = gif_get_block (fp, buf + last_byte)) <= 0)
33+ if ((count = gif_get_block(fp, buf + last_byte)) <= 0)
34 {
35 /*
36 * Whoops, no more data!
37@@ -582,19 +582,13 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
38 gif_get_code(fp, 0, 1);
39
40 /*
41- * Wipe the decompressor table...
42+ * Wipe the decompressor table (already mostly 0 due to the calloc above...)
43 */
44
45 fresh = 1;
46
47- for (i = 0; i < clear_code; i ++)
48- {
49- table[0][i] = 0;
50+ for (i = 1; i < clear_code; i ++)
51 table[1][i] = i;
52- }
53-
54- for (; i < 4096; i ++)
55- table[0][i] = table[1][0] = 0;
56
57 sp = stack;
58
59@@ -605,29 +599,30 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
60 fresh = 0;
61
62 do
63+ {
64 firstcode = oldcode = gif_get_code(fp, code_size, 0);
65+ }
66 while (firstcode == clear_code);
67
68- return (firstcode);
69+ return (firstcode & 255);
70 }
71 else if (!table)
72 return (0);
73
74 if (sp > stack)
75- return (*--sp);
76+ return ((*--sp) & 255);
77
78- while ((code = gif_get_code (fp, code_size, 0)) >= 0)
79+ while ((code = gif_get_code(fp, code_size, 0)) >= 0)
80 {
81 if (code == clear_code)
82 {
83- for (i = 0; i < clear_code; i ++)
84- {
85- table[0][i] = 0;
86- table[1][i] = i;
87- }
88+ /*
89+ * Clear/reset the compression table...
90+ */
91
92- for (; i < 4096; i ++)
93- table[0][i] = table[1][i] = 0;
94+ memset(table, 0, 2 * sizeof(gif_table_t));
95+ for (i = 1; i < clear_code; i ++)
96+ table[1][i] = i;
97
98 code_size = set_code_size + 1;
99 max_code_size = 2 * clear_code;
100@@ -637,12 +632,11 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
101
102 firstcode = oldcode = gif_get_code(fp, code_size, 0);
103
104- return (firstcode);
105+ return (firstcode & 255);
106 }
107- else if (code == end_code)
108+ else if (code == end_code || code > max_code)
109 {
110- unsigned char buf[260];
111-
112+ unsigned char buf[260]; /* Block buffer */
113
114 if (!gif_eof)
115 while (gif_get_block(fp, buf) > 0);
116@@ -652,7 +646,7 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
117
118 incode = code;
119
120- if (code >= max_code)
121+ if (code == max_code)
122 {
123 if (sp < (stack + 8192))
124 *sp++ = firstcode;
125@@ -690,10 +684,10 @@ gif_read_lzw(FILE *fp, /* I - File to read from */
126 oldcode = incode;
127
128 if (sp > stack)
129- return (*--sp);
130+ return ((*--sp) & 255);
131 }
132
133- return (code);
134+ return (code & 255);
135 }
136
137
138--
1391.7.0.5
140
diff --git a/meta/recipes-extended/cups/cups_1.4.6.bb b/meta/recipes-extended/cups/cups_1.4.6.bb
index 53dc149..7cecd7f 100644
--- a/meta/recipes-extended/cups/cups_1.4.6.bb
+++ b/meta/recipes-extended/cups/cups_1.4.6.bb
@@ -1,6 +1,6 @@
1require cups14.inc 1require cups14.inc
2 2
3PR = "r7" 3PR = "r8"
4DEPENDS += "libusb \ 4DEPENDS += "libusb \
5 ${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" 5 ${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
6 6
@@ -9,6 +9,7 @@ SRC_URI += " \
9 file://use_echo_only_in_init.patch \ 9 file://use_echo_only_in_init.patch \
10 file://0001-don-t-try-to-run-generated-binaries.patch \ 10 file://0001-don-t-try-to-run-generated-binaries.patch \
11 file://cups_serverbin.patch \ 11 file://cups_serverbin.patch \
12 file://cups-CVE-2011-2896.patch \
12 file://cups-CVE-2012-5519.patch \ 13 file://cups-CVE-2012-5519.patch \
13 " 14 "
14 15