diff options
author | Phillip Lougher | 2012-03-09 04:02:59 +0100 |
---|---|---|
committer | Phillip Lougher | 2012-03-10 04:01:02 +0100 |
commit | 4b0180a49f08dd1c681cdc99edc9e0cec0a833fa (patch) | |
tree | 816d9a9095b816683c8edc2089d510880fd59d35 /fs/squashfs/lzo_wrapper.c | |
parent | Squashfs: fix f_pos check in get_dir_index_using_offset (diff) | |
download | kernel-qcow2-linux-4b0180a49f08dd1c681cdc99edc9e0cec0a833fa.tar.gz kernel-qcow2-linux-4b0180a49f08dd1c681cdc99edc9e0cec0a833fa.tar.xz kernel-qcow2-linux-4b0180a49f08dd1c681cdc99edc9e0cec0a833fa.zip |
Squashfs: add mount time sanity check for block_size and block_log match
Squashfs currently has a sanity check for block_size less than or
equal to the maximum block_size (1 Mbyte). This catches some
superblock corruption, but obviously with a block_size maximum
of 1 Mbyte there's 7 correct values (4K, 8K, 16K, 32K, ... etc) and
a lot of incorrect values which are not caught by this check.
The Squashfs superblock, however, has both a block_size and
a block_log (2^block_log == block_size). Checking that the block_size
matches the block_log is a much more robust check. Corruption of the
superblock is unlikely to produce values which match, and it also
ensures the block_size is an exact power of two.
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
Diffstat (limited to 'fs/squashfs/lzo_wrapper.c')
0 files changed, 0 insertions, 0 deletions