Skip to content

Commit 953f918

Browse files
torvaldsgregkh
authored andcommitted
squashfs: more metadata hardening
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 <[email protected]> Acked-by: Phillip Lougher <[email protected]> Cc: [email protected] Signed-off-by: Linus Torvalds <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent a766ccb commit 953f918

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/squashfs/block.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ int squashfs_read_data(struct super_block *sb, u64 index, int length,
167167
}
168168

169169
if (compressed) {
170+
if (!msblk->stream)
171+
goto read_failure;
170172
length = squashfs_decompress(msblk, bh, b, offset, length,
171173
output);
172174
if (length < 0)

0 commit comments

Comments
 (0)