diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-07-31 00:27:15 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-08-06 17:23:03 +0300 |
commit | 3abef06039cb43e0fe44f3714969af0b9a744dc5 (patch) | |
tree | e04785e48629bb3441618c115868db3d7b459411 /fs/squashfs | |
parent | c9bd4fd4b744089f368f3d85655e904a76c93c25 (diff) | |
download | linux-3abef06039cb43e0fe44f3714969af0b9a744dc5.tar.xz |
squashfs: more metadata hardening
commit d512584780d3e6a7cacb2f482834849453d444a1 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>
Diffstat (limited to 'fs/squashfs')
-rw-r--r-- | fs/squashfs/block.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/squashfs/block.c b/fs/squashfs/block.c index ce62a380314f..cec0fa208078 100644 --- a/fs/squashfs/block.c +++ b/fs/squashfs/block.c @@ -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) |