Squashfs: fix variable overflow triggered by sysbot
authorPhillip Lougher <phillip@squashfs.org.uk>
Mon, 13 Nov 2023 16:09:01 +0000 (16:09 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 11 Dec 2023 01:21:26 +0000 (17:21 -0800)
commit12427de9439d68b8e96ba6f50b601ef15f437612
treeff3571cb2a307d3c05c9d58653e2e64ba7e6f55a
parent44e3876d268be49ee810481ee3c95d8d650bf22e
Squashfs: fix variable overflow triggered by sysbot

Sysbot reports a slab out of bounds write in squashfs_readahead().

This is ultimately caused by a file reporting an (infeasibly) large file
size (1407374883553280 bytes) with the minimum block size of 4K.

This causes variable overflow.

Link: https://lkml.kernel.org/r/20231113160901.6444-1-phillip@squashfs.org.uk
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
Reported-by: syzbot+604424eb051c2f696163@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/000000000000b1fda20609ede0d1@google.com/
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
fs/squashfs/file.c
fs/squashfs/file_direct.c