Skip to content

Commit

Permalink
squashfs: more metadata hardening
Browse files Browse the repository at this point in the history
commit d512584 upstream.

Anatoly reports another squashfs fuzzing issue, where the decompression
parameters themselves are in a compressed block.

This causes squashfs_read_data() to be called in order to read the
decompression options before the decompression stream having been set
up, making squashfs go sideways.

Reported-by: Anatoly Trosinenko <anatoly.trosinenko@gmail.com>
Acked-by: Phillip Lougher <phillip.lougher@gmail.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Linus Torvalds authored and Greg Kroah-Hartman committed Aug 6, 2018
1 parent 8cac0ce commit dac2939
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/squashfs/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ int squashfs_read_data(struct super_block *sb, u64 index, int length,
}

if (compressed) {
if (!msblk->stream)
goto read_failure;
length = squashfs_decompress(msblk, bh, b, offset, length,
output);
if (length < 0)
Expand Down

0 comments on commit dac2939

Please sign in to comment.