diff options
| -rw-r--r-- | meta/recipes-extended/cups/cups-1.4.6/cups-CVE-2011-2896.patch | 140 | ||||
| -rw-r--r-- | meta/recipes-extended/cups/cups_1.4.6.bb | 3 |
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 0000000000..7c6f75bd6c --- /dev/null +++ b/meta/recipes-extended/cups/cups-1.4.6/cups-CVE-2011-2896.patch | |||
| @@ -0,0 +1,140 @@ | |||
| 1 | cups - CVE-2011-2896 | ||
| 2 | |||
| 3 | the patch come from: | ||
| 4 | http://cups.org/strfiles/3867/str3867.patch | ||
| 5 | |||
| 6 | The LZW decompressor in the LWZReadByte function in giftoppm.c | ||
| 7 | in the David Koblas GIF decoder in PBMPLUS, as used in the | ||
| 8 | gif_read_lzw function in filter/image-gif.c in CUPS before 1.4.7, | ||
| 9 | the LZWReadByte function in plug-ins/common/file-gif-load.c | ||
| 10 | in GIMP 2.6.11 and earlier, the LZWReadByte function in img/gifread.c | ||
| 11 | in XPCE in SWI-Prolog 5.10.4 and earlier, and other products, | ||
| 12 | does not properly handle code words that are absent from the | ||
| 13 | decompression table when encountered, which allows remote attackers to | ||
| 14 | trigger an infinite loop or a heap-based buffer overflow, and possibly | ||
| 15 | execute arbitrary code, via a crafted compressed stream, a related | ||
| 16 | issue to CVE-2006-1168 and CVE-2011-2895. | ||
| 17 | http://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2011-2896 | ||
| 18 | |||
| 19 | Integrated-by: Li Wang <li.wang@windriver.com> | ||
| 20 | --- | ||
| 21 | filter/image-gif.c | 46 ++++++++++++++++++++-------------------------- | ||
| 22 | 1 files changed, 20 insertions(+), 26 deletions(-) | ||
| 23 | |||
| 24 | diff --git a/filter/image-gif.c b/filter/image-gif.c | ||
| 25 | index 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 | -- | ||
| 139 | 1.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 53dc149bf5..7cecd7fc82 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 @@ | |||
| 1 | require cups14.inc | 1 | require cups14.inc |
| 2 | 2 | ||
| 3 | PR = "r7" | 3 | PR = "r8" |
| 4 | DEPENDS += "libusb \ | 4 | DEPENDS += "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 | ||
