]> git.baikalelectronics.ru Git - kernel.git/commit
Squashfs: add sanity checks to fragment reading at mount time
authorPhillip Lougher <phillip@lougher.demon.co.uk>
Tue, 24 May 2011 03:33:34 +0000 (04:33 +0100)
committerPhillip Lougher <phillip@lougher.demon.co.uk>
Wed, 25 May 2011 17:21:33 +0000 (18:21 +0100)
commitdee4f103aef0fd127a1365752abaab38a52a2315
tree31ee36dac4a1b351c153058ffa0799a959ba0272
parentb7d84c20a1abab1c1e70fce34c223f0f52f0865b
Squashfs: add sanity checks to fragment reading at mount time

Fsfuzzer generates corrupted filesystems which throw a warn_on in
kmalloc.  One of these is due to a corrupted superblock fragments field.
Fix this by checking that the number of bytes to be read (and allocated)
does not extend into the next filesystem structure.

Also add a couple of other sanity checks of the mount-time fragment table
structures.

Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
fs/squashfs/fragment.c
fs/squashfs/squashfs.h
fs/squashfs/super.c