]> git.baikalelectronics.ru Git - kernel.git/commit
initramfs: handle unrecognised decompressor when unpacking
authorPhillip Lougher <phillip@lougher.demon.co.uk>
Fri, 23 Apr 2010 17:18:11 +0000 (13:18 -0400)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 24 Apr 2010 18:31:26 +0000 (11:31 -0700)
commit2fad070861201618321f3f6da49391ce111d52a9
tree46828c4ed92f4bbd009392a5bad659555872b276
parent20255be2a887de111ae48c2ace7674a837d19053
initramfs: handle unrecognised decompressor when unpacking

The unpack routine fails to handle the decompress_method() returning
unrecognised decompressor (compress_name == NULL).  This results in the
routine looping eventually oopsing on an out of bounds memory access.

Note this bug is usually hidden, only triggering on trailing junk after
one or more correct compressed blocks.  The case of the compressed archive
being complete junk is (by accident?) caught by the if (state != Reset)
check because state is initialised to Start, but not updated due to the
decompressor not having been called.  Obviously if the junk is trailing a
correctly decompressed buffer, state == Reset from the previous call to
the decompressor.

Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
Reported-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
init/initramfs.c