summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorPhillip Lougher <phillip@squashfs.org.uk>2026-08-07 17:29:51 +0100
committerAndrew Morton <akpm@linux-foundation.org>2026-08-13 15:42:08 -0700
commite300eb5002925b29be803d2661af07266cfa267e (patch)
treecd1cb32e21e141109c8f272e04de9b7bd5049d4c /tools/lib/python
parent9b836cd566815ab6302cfe56a7e432376e119652 (diff)
downloadlinux-e300eb5002925b29be803d2661af07266cfa267e.tar.gz
linux-e300eb5002925b29be803d2661af07266cfa267e.zip
Squashfs: check block offset is not negative
If a negative offset is read off disk (for example the offset into the decompressed fragment block), this will cause squashfs_copy_data() to perform an out of bounds access. Fix by checking if offset is negative, and returning 0. This matches existing behaviour where an offset beyond the block returns 0 bytes copied. To trigger this out of bounds access requires a crafted Squashfs filesystem and CAP_SYS_ADMIN to mount it. Unprivileged users will not be able to mount such a filesystem, but once mounted, an unprivileged user can trigger the out of bounds access by reading the crafted file with the negative offset. Link: https://lore.kernel.org/20260807162951.672510-1-phillip@squashfs.org.uk Fixes: f400e12656ab ("Squashfs: cache operations") Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk> Reported-by: Yuejie Shi <syjcnss@gmail.com> Closes: https://lore.kernel.org/all/20260803032735.81785-1-syjcnss@gmail.com/ Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions