Skip to content

Commit

Permalink
squashfs: more metadata hardening
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Phillip Lougher <[email protected]>
Cc: [email protected]
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
torvalds committed Jul 31, 2018
1 parent 527838d commit d512584
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 @@ -167,6 +167,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 d512584

Please sign in to comment.