]> git.karo-electronics.de Git - karo-tx-linux.git/commit
Squashfs: handle corruption of directory structure
authorPhillip Lougher <phillip@lougher.demon.co.uk>
Tue, 15 Mar 2011 22:09:55 +0000 (22:09 +0000)
committerPaul Gortmaker <paul.gortmaker@windriver.com>
Wed, 14 Mar 2012 14:57:07 +0000 (10:57 -0400)
commit8748b23d4aae479a1fc7a54eb4e467cb9b2bbd91
treefb23c01d81accf08bc1cf5f846079493ee63b1e2
parentcb500c50d297d2c286f191c1118028d3abc77c90
Squashfs: handle corruption of directory structure

commit 44cff8a9ee8a974f9e931df910688e7fc1f0b0f9 upstream.

Handle the rare case where a directory metadata block is uncompressed and
corrupted, leading to a kernel oops in directory scanning (memcpy).
Normally corruption is detected at the decompression stage and dealt with
then, however, this will not happen if:

- metadata isn't compressed (users can optionally request no metadata
  compression), or
- the compressed metadata block was larger than the original, in which
  case the uncompressed version was used, or
- the data was corrupt after decompression

This patch fixes this by adding some sanity checks against known maximum
values.

Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
fs/squashfs/dir.c
fs/squashfs/namei.c