]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: correct inline offset when handling xattrs in inode body
authorEric Whitney <enwlinux@gmail.com>
Mon, 22 May 2023 18:15:20 +0000 (14:15 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 11 Aug 2023 09:33:47 +0000 (11:33 +0200)
commitd9cddeb22d00139963462028c02d3861b3d31859
tree0ac5ac1b5c950b09ba13f2321f9bb80c4fe9bdb8
parent11b8e27ed448baa385d90154a141466bd5e92f18
ext4: correct inline offset when handling xattrs in inode body

commit 6909cf5c4101214f4305a62d582a5b93c7e1eb9a upstream.

When run on a file system where the inline_data feature has been
enabled, xfstests generic/269, generic/270, and generic/476 cause ext4
to emit error messages indicating that inline directory entries are
corrupted.  This occurs because the inline offset used to locate
inline directory entries in the inode body is not updated when an
xattr in that shared region is deleted and the region is shifted in
memory to recover the space it occupied.  If the deleted xattr precedes
the system.data attribute, which points to the inline directory entries,
that attribute will be moved further up in the region.  The inline
offset continues to point to whatever is located in system.data's former
location, with unfortunate effects when used to access directory entries
or (presumably) inline data in the inode body.

Cc: stable@kernel.org
Signed-off-by: Eric Whitney <enwlinux@gmail.com>
Link: https://lore.kernel.org/r/20230522181520.1570360-1-enwlinux@gmail.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/xattr.c