aboutsummaryrefslogtreecommitdiffstats
path: root/fs/squashfs/block.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2011-01-13Squashfs: move squashfs_i() definition from squashfs.hPhillip Lougher1-1/+0
Move squashfs_i() definition out of squashfs.h, this eliminates the need to #include squashfs_fs_i.h from numerous files. Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
2010-04-25squashfs: fix potential buffer over-run on 4K block file systemsPhillip Lougher1-3/+2
Sizing the buffer based on block size is incorrect, leading to a potential buffer over-run on 4K block size file systems (because the metadata block size is always 8K). This bug doesn't seem have triggered because 4K block size file systems are not default, and also because metadata blocks after compression tend to be less than 4K. Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
2010-01-20Squashfs: add a decompressor frameworkPhillip Lougher1-1/+2
This adds a decompressor framework which allows multiple compression algorithms to be cleanly supported. Also update zlib wrapper and other code to use the new framework. Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
2010-01-20Squashfs: factor out remaining zlib dependencies into separate wrapper filePhillip Lougher1-1/+0
Move zlib buffer init/destroy code into separate wrapper file. Also make zlib z_stream field a void * removing the need to include zlib.h for most files. Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
2010-01-20Squashfs: move zlib decompression wrapper code into a separate filePhillip Lougher1-70/+4
Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
2009-03-12Squashfs: Valid filesystems are flagged as bad by the corrupted fs patchPhillip Lougher1-17/+4
The corrupted filesystem patch added a check against zlib trying to output too much data in the presence of data corruption. This check triggered if zlib_inflate asked to be called again (Z_OK) with avail_out == 0 and no more output buffers available. This check proves to be rather dumb, as it incorrectly catches the case where zlib has generated all the output, but there are still input bytes to be processed. This patch does a number of things. It removes the original check and replaces it with code to not move to the next output buffer if there are no more output buffers available, relying on zlib to error if it wants an extra output buffer in the case of data corruption. It also replaces the Z_NO_FLUSH flag with the more correct Z_SYNC_FLUSH flag, and makes the error messages more understandable to non-technical users. Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk> Reported-by: Stefan Lippers-Hollmann <s.L-H@gmx.de>
2009-03-05Squashfs: Fix oops when reading fsfuzzer corrupted filesystemsPhillip Lougher1-2/+11
This fixes a code regression caused by the recent mainlining changes. The recent code changes call zlib_inflate repeatedly, decompressing into separate 4K buffers, this code didn't check for the possibility that zlib_inflate might ask for too many buffers when decompressing corrupted data. Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
2009-01-05Squashfs: block operationsPhillip Lougher1-0/+274
Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>