summaryrefslogtreecommitdiff
path: root/fs/9p
diff options
context:
space:
mode:
authorRitesh Harjani <riteshh@linux.ibm.com>2021-06-05 10:39:32 +0530
committerTheodore Ts'o <tytso@mit.edu>2021-10-01 00:03:51 -0400
commit75ca6ad408f459f00b09a64f04c774559848c097 (patch)
treefede0d63735d43b1a774ff76fc80597fe0a29e13 /fs/9p
parent6fed83957f21eff11c8496e9f24253b03d2bc1dc (diff)
downloadlinux-75ca6ad408f459f00b09a64f04c774559848c097.tar.gz
linux-75ca6ad408f459f00b09a64f04c774559848c097.tar.bz2
linux-75ca6ad408f459f00b09a64f04c774559848c097.zip
ext4: fix loff_t overflow in ext4_max_bitmap_size()
We should use unsigned long long rather than loff_t to avoid overflow in ext4_max_bitmap_size() for comparison before returning. w/o this patch sbi->s_bitmap_maxbytes was becoming a negative value due to overflow of upper_limit (with has_huge_files as true) Below is a quick test to trigger it on a 64KB pagesize system. sudo mkfs.ext4 -b 65536 -O ^has_extents,^64bit /dev/loop2 sudo mount /dev/loop2 /mnt sudo echo "hello" > /mnt/hello -> This will error out with "echo: write error: File too large" Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org Link: https://lore.kernel.org/r/594f409e2c543e90fd836b78188dfa5c575065ba.1622867594.git.riteshh@linux.ibm.com Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/9p')
0 files changed, 0 insertions, 0 deletions