mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-11-30 15:53:22 -05:00
ext4: fix EXT4_MAX_LOGICAL_BLOCK macro
commit 175efa81feb8405676e0136d97b10380179c92e0 upstream.
ext4 supports max number of logical blocks in a file to be 0xffffffff.
(This is since ext4_extent's ee_block is __le32).
This means that EXT4_MAX_LOGICAL_BLOCK should be 0xfffffffe (starting
from 0 logical offset). This patch fixes this.
The issue was seen when ext4 moved to iomap_fiemap API and when
overlayfs was mounted on top of ext4. Since overlayfs was missing
filemap_check_ranges(), so it could pass a arbitrary huge length which
lead to overflow of map.m_len logic.
This patch fixes that.
Fixes: d3b6f23f7167 ("ext4: move ext4_fiemap to use iomap framework")
Reported-by: [email protected]
Signed-off-by: Ritesh Harjani <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Signed-off-by: Christoph Hellwig <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
Signed-off-by: George Kennedy <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
c15b830f7c
commit
81d152c8da
1 changed files with 1 additions and 1 deletions
|
|
@ -718,7 +718,7 @@ enum {
|
|||
#define EXT4_MAX_BLOCK_FILE_PHYS 0xFFFFFFFF
|
||||
|
||||
/* Max logical block we can support */
|
||||
#define EXT4_MAX_LOGICAL_BLOCK 0xFFFFFFFF
|
||||
#define EXT4_MAX_LOGICAL_BLOCK 0xFFFFFFFE
|
||||
|
||||
/*
|
||||
* Structure of an inode on the disk
|
||||
|
|
|
|||
Loading…
Reference in a new issue