• R/O
  • HTTP
  • SSH
  • HTTPS

linux-2.4.36: Commit

2.4.36-stable kernel tree


Commit MetaInfo

Revisioncd28e52cc3631e2a336a7bbaa9d01e8478eb759c (tree)
Zeit2005-07-27 00:47:36
AutorTim Yamin <plasmaroo@gent...>
CommiterMarcelo Tosatti

Log Message

The gzip description is as good as the ChangeLog says it is -: "Set n to
length of v, to detect improper tables" and "Don't accidentally grow j
past z". The return 2 instead of the return 0 is so that we actually
error out if we also get inproper tables (for some reason the code
returned "OK" in such cases).

Fix outstanding security bugs in the Linux zlib implementations. See:

a) http://sources.redhat.com/ml/bug-gnu-utils/1999-06/msg00183.html
b) http://bugs.gentoo.org/show_bug.cgi?id=94584

Signed-off-by: Tim Yamin <plasmaroo@gentoo.org>
Signed-off-by: Tavis Ormandy <taviso@gentoo.org>

Ändern Zusammenfassung

Diff

--- a/arch/ppc/boot/lib/zlib.c
+++ b/arch/ppc/boot/lib/zlib.c
@@ -1278,7 +1278,7 @@ z_stream *zs; /* for zalloc function */
12781278 {
12791279 *t = (inflate_huft *)Z_NULL;
12801280 *m = 0;
1281- return Z_OK;
1281+ return Z_DATA_ERROR;
12821282 }
12831283
12841284
@@ -1322,6 +1322,7 @@ z_stream *zs; /* for zalloc function */
13221322 if ((j = *p++) != 0)
13231323 v[x[j]++] = i;
13241324 } while (++i < n);
1325+ n = x[g]; /* set n to length of v */
13251326
13261327
13271328 /* Generate the Huffman codes and for each, make the table entries */
--- a/arch/ppc64/boot/zlib.c
+++ b/arch/ppc64/boot/zlib.c
@@ -1294,7 +1294,7 @@ z_stream *zs; /* for zalloc function */
12941294 {
12951295 *t = (inflate_huft *)Z_NULL;
12961296 *m = 0;
1297- return Z_OK;
1297+ return Z_DATA_ERROR;
12981298 }
12991299
13001300
@@ -1338,6 +1338,7 @@ z_stream *zs; /* for zalloc function */
13381338 if ((j = *p++) != 0)
13391339 v[x[j]++] = i;
13401340 } while (++i < n);
1341+ n = x[g]; /* set n to length of v */
13411342
13421343
13431344 /* Generate the Huffman codes and for each, make the table entries */
--- a/lib/inflate.c
+++ b/lib/inflate.c
@@ -320,7 +320,7 @@ DEBG("huft1 ");
320320 {
321321 *t = (struct huft *)NULL;
322322 *m = 0;
323- return 0;
323+ return 2;
324324 }
325325
326326 DEBG("huft2 ");
@@ -368,6 +368,7 @@ DEBG("huft5 ");
368368 if ((j = *p++) != 0)
369369 v[x[j]++] = i;
370370 } while (++i < n);
371+ n = x[g]; /* set n to length of v */
371372
372373 DEBG("h6 ");
373374
@@ -404,12 +405,13 @@ DEBG1("1 ");
404405 DEBG1("2 ");
405406 f -= a + 1; /* deduct codes from patterns left */
406407 xp = c + k;
407- while (++j < z) /* try smaller tables up to z bits */
408- {
409- if ((f <<= 1) <= *++xp)
410- break; /* enough codes to use up j bits */
411- f -= *xp; /* else deduct codes from patterns */
412- }
408+ if (j < z)
409+ while (++j < z) /* try smaller tables up to z bits */
410+ {
411+ if ((f <<= 1) <= *++xp)
412+ break; /* enough codes to use up j bits */
413+ f -= *xp; /* else deduct codes from patterns */
414+ }
413415 }
414416 DEBG1("3 ");
415417 z = 1 << j; /* table entries for j-bit table */
--- a/lib/zlib_inflate/inftrees.c
+++ b/lib/zlib_inflate/inftrees.c
@@ -140,7 +140,7 @@ uIntf *v; /* working area: values in order of bit length */
140140 {
141141 *t = (inflate_huft *)Z_NULL;
142142 *m = 0;
143- return Z_OK;
143+ return Z_DATA_ERROR;
144144 }
145145
146146
Show on old repository browser