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:36:31 +0000 (09:36 +0200)
commit9703952178f1412b7a74e170298d58e96c53152f
tree0c4252508607b9de295174ae23ce94e3cb522fa1
parent598e04ae2fc402c364d3f0ee76599783149f573f
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