diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-07-08 14:10:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-07-08 14:10:30 -0400 |
commit | 70a2dc6abc8af028b0c71af6b3520574ee09e814 (patch) | |
tree | 935075ce55d5091d5508ff9be533959703e25410 /fs/ext4/inode.c | |
parent | 8979319f2d361b5729b215e1d47cb5bbcaca9d76 (diff) | |
parent | a17712c8e4be4fa5404d20e9cd3b2b21eae7bc56 (diff) |
Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4
Pull ext4 bugfixes from Ted Ts'o:
"Bug fixes for ext4; most of which relate to vulnerabilities where a
maliciously crafted file system image can result in a kernel OOPS or
hang.
At least one fix addresses an inline data bug could be triggered by
userspace without the need of a crafted file system (although it does
require that the inline data feature be enabled)"
* tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
ext4: check superblock mapped prior to committing
ext4: add more mount time checks of the superblock
ext4: add more inode number paranoia checks
ext4: avoid running out of journal credits when appending to an inline file
jbd2: don't mark block as modified if the handle is out of credits
ext4: never move the system.data xattr out of the inode body
ext4: clear i_data in ext4_inode_info when removing inline data
ext4: include the illegal physical block in the bad map ext4_error msg
ext4: verify the depth of extent tree in ext4_find_extent()
ext4: only look at the bg_flags field if it is valid
ext4: make sure bitmaps and the inode table don't overlap with bg descriptors
ext4: always check block group bounds in ext4_init_block_bitmap()
ext4: always verify the magic number in xattr blocks
ext4: add corruption check in ext4_xattr_set_entry()
ext4: add warn_on_error mount option
Diffstat (limited to 'fs/ext4/inode.c')
-rw-r--r-- | fs/ext4/inode.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 2ea07efbe016..7d6c10017bdf 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -402,9 +402,9 @@ static int __check_block_validity(struct inode *inode, const char *func, | |||
402 | if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), map->m_pblk, | 402 | if (!ext4_data_block_valid(EXT4_SB(inode->i_sb), map->m_pblk, |
403 | map->m_len)) { | 403 | map->m_len)) { |
404 | ext4_error_inode(inode, func, line, map->m_pblk, | 404 | ext4_error_inode(inode, func, line, map->m_pblk, |
405 | "lblock %lu mapped to illegal pblock " | 405 | "lblock %lu mapped to illegal pblock %llu " |
406 | "(length %d)", (unsigned long) map->m_lblk, | 406 | "(length %d)", (unsigned long) map->m_lblk, |
407 | map->m_len); | 407 | map->m_pblk, map->m_len); |
408 | return -EFSCORRUPTED; | 408 | return -EFSCORRUPTED; |
409 | } | 409 | } |
410 | return 0; | 410 | return 0; |
@@ -4506,7 +4506,8 @@ static int __ext4_get_inode_loc(struct inode *inode, | |||
4506 | int inodes_per_block, inode_offset; | 4506 | int inodes_per_block, inode_offset; |
4507 | 4507 | ||
4508 | iloc->bh = NULL; | 4508 | iloc->bh = NULL; |
4509 | if (!ext4_valid_inum(sb, inode->i_ino)) | 4509 | if (inode->i_ino < EXT4_ROOT_INO || |
4510 | inode->i_ino > le32_to_cpu(EXT4_SB(sb)->s_es->s_inodes_count)) | ||
4510 | return -EFSCORRUPTED; | 4511 | return -EFSCORRUPTED; |
4511 | 4512 | ||
4512 | iloc->block_group = (inode->i_ino - 1) / EXT4_INODES_PER_GROUP(sb); | 4513 | iloc->block_group = (inode->i_ino - 1) / EXT4_INODES_PER_GROUP(sb); |