]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/pseries: Fix buffer overflow when reading from pstore
authorAruna Balakrishnaiah <aruna@linux.vnet.ibm.com>
Thu, 8 Aug 2013 17:03:49 +0000 (22:33 +0530)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Fri, 9 Aug 2013 08:06:40 +0000 (18:06 +1000)
commit21d7aac6f01a487b1f0fb1830bc0412848d02d85
treefe4ceca869426702d81b5dbf0a924adbd9708725
parent59fef161fd5247e420bb6a610070d083d6c25d4d
powerpc/pseries: Fix buffer overflow when reading from pstore

When reading from pstore there is a buffer overflow during decompression
due to the header added in unzip_oops. Remove unzip_oops and call
pstore_decompress directly in nvram_pstore_read. Allocate buffer of size
report_length of the oops header as header will not be deallocated in pstore.
Since we have 'openssl' command line tool to decompress the compressed data,
dump the compressed data in case decompression fails instead of not dumping
anything.

Signed-off-by: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/platforms/pseries/nvram.c