linux-yocto/fs/squashfs
Phillip Lougher f271155ff3 Squashfs: reject negative file sizes in squashfs_read_inode()
[ Upstream commit 9f1c14c1de ]

Syskaller reports a "WARNING in ovl_copy_up_file" in overlayfs.

This warning is ultimately caused because the underlying Squashfs file
system returns a file with a negative file size.

This commit checks for a negative file size and returns EINVAL.

[phillip@squashfs.org.uk: only need to check 64 bit quantity]
  Link: https://lkml.kernel.org/r/20250926222305.110103-1-phillip@squashfs.org.uk
Link: https://lkml.kernel.org/r/20250926215935.107233-1-phillip@squashfs.org.uk
Fixes: 6545b246a2 ("Squashfs: inode operations")
Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
Reported-by: syzbot+f754e01116421e9754b9@syzkaller.appspotmail.com
Closes: https://lore.kernel.org/all/68d580e5.a00a0220.303701.0019.GAE@google.com/
Cc: Amir Goldstein <amir73il@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-10-19 16:37:42 +02:00
..
block.c squashfs: fix incorrect argument to sizeof in kmalloc_array call 2025-07-19 19:08:27 -07:00
cache.c squashfs: fix invalid pointer dereference in squashfs_cache_delete 2025-03-16 17:40:24 -07:00
decompressor_multi_percpu.c squashfs: fix percpu address space issues in decompressor_multi_percpu.c 2024-09-09 16:47:41 -07:00
decompressor_multi.c
decompressor_single.c
decompressor.c
decompressor.h
dir.c
export.c
file_cache.c squashfs; convert squashfs_copy_cache() to take a folio 2025-01-24 22:47:22 -08:00
file_direct.c squashfs: convert squashfs_readpage_block() to take a folio 2025-01-24 22:47:22 -08:00
file.c squashfs: pass the inode to squashfs_readahead_fragment() 2025-07-09 22:57:50 -07:00
fragment.c
id.c
inode.c Squashfs: reject negative file sizes in squashfs_read_inode() 2025-10-19 16:37:42 +02:00
Kconfig squashfs: add optional full compressed block caching 2025-05-27 19:40:33 -07:00
lz4_wrapper.c
lzo_wrapper.c
Makefile
namei.c
page_actor.c Squashfs: Update page_actor to not use page->index 2024-08-19 14:08:20 +02:00
page_actor.h Squashfs: Ensure all readahead pages have been used 2024-08-23 13:11:36 +02:00
squashfs_fs_i.h Squashfs: fix uninit-value in squashfs_get_parent 2025-10-15 12:04:15 +02:00
squashfs_fs_sb.h
squashfs_fs.h
squashfs.h squashfs: convert squashfs_fill_page() to take a folio 2025-01-24 22:47:22 -08:00
super.c squashfs: fix memory leak in squashfs_fill_super 2025-08-19 16:35:53 -07:00
symlink.c
xattr_id.c
xattr.c
xattr.h
xz_wrapper.c
zlib_wrapper.c
zstd_wrapper.c