]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix checking of directory entry validity for inline directories
authorJan Kara <jack@suse.cz>
Fri, 31 Jul 2020 16:21:35 +0000 (18:21 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 7 Aug 2020 20:04:27 +0000 (16:04 -0400)
commitb5dc84282db48b852cf04f70124e3cc0a073c0f4
tree8b54df9eeccd55137323f950ca9bcbd681d4876a
parent163bbcb6e4eefe4b4faf458ec7168aea61284b6b
ext4: fix checking of directory entry validity for inline directories

ext4_search_dir() and ext4_generic_delete_entry() can be called both for
standard director blocks and for inline directories stored inside inode
or inline xattr space. For the second case we didn't call
ext4_check_dir_entry() with proper constraints that could result in
accepting corrupted directory entry as well as false positive filesystem
errors like:

EXT4-fs error (device dm-0): ext4_search_dir:1395: inode #28320400:
block 113246792: comm dockerd: bad entry in directory: directory entry too
close to block end - offset=0, inode=28320403, rec_len=32, name_len=8,
size=4096

Fix the arguments passed to ext4_check_dir_entry().

Fixes: 672c5a4faedf ("ext4: check for directory entries too close to block end")
CC: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20200731162135.8080-1-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/namei.c