]> 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:11:50 +0000 (11:11 +0200)
commit5a229d21b98d132673096710e8281ef522dab1d1
treed4aafa51c9f13a790c73da086b1e7900aff88cec
parent7dd95a282809fec91e54867a92e271064284ad98
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