ext4: add bounds checking to ext4_xattr_find_entry()
authorTheodore Ts'o <tytso@mit.edu>
Sat, 31 Mar 2018 00:00:56 +0000 (20:00 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Apr 2018 07:42:59 +0000 (09:42 +0200)
commite89600dc2411982169cc54a0760aaede29b172fb
tree1d5bc2bce4f3de945577b5c51e1f9878623351aa
parent8cefea5589189c1444c8c3a6e01e510230b29077
ext4: add bounds checking to ext4_xattr_find_entry()

commit 9496005d6ca4cf8f5ee8f828165a8956872dc59d upstream.

Add some paranoia checks to make sure we don't stray beyond the end of
the valid memory region containing ext4 xattr entries while we are
scanning for a match.

Also rename the function to xattr_find_entry() since it is static and
thus only used in fs/ext4/xattr.c

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/xattr.c