]> 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:50:30 +0000 (11:50 +0200)
commitf22b274429e88d3dc7e79d375b56ce4f2f59f0b4
treec33ac511bd1f81be99616d042365004cbd36b377
parent640c8c365999c6f23447ac766437236ad88317c5
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