]> git.itanic.dy.fi Git - linux-stable/commit
ext4: add bounds checking in get_max_inline_xattr_value_size()
authorTheodore Ts'o <tytso@mit.edu>
Fri, 12 May 2023 19:11:02 +0000 (15:11 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:53:58 +0000 (11:53 +0200)
commit1d2caddbeeee56fbbc36b428c5b909c3ad88eb7f
treeec5bee7f8c7fda4ec18bdd021874ea42c23870f2
parent665cc3ba50330049524c1d275bc840a8f28dde73
ext4: add bounds checking in get_max_inline_xattr_value_size()

commit 2220eaf90992c11d888fe771055d4de330385f01 upstream.

Normally the extended attributes in the inode body would have been
checked when the inode is first opened, but if someone is writing to
the block device while the file system is mounted, it's possible for
the inode table to get corrupted.  Add bounds checking to avoid
reading beyond the end of allocated memory if this happens.

Reported-by: syzbot+1966db24521e5f6e23f7@syzkaller.appspotmail.com
Link: https://syzkaller.appspot.com/bug?extid=1966db24521e5f6e23f7
Cc: stable@kernel.org
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/inline.c