ext4: check EA value offset when loading
authorDarrick J. Wong <darrick.wong@oracle.com>
Tue, 16 Sep 2014 18:34:59 +0000 (14:34 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Nov 2014 16:59:57 +0000 (08:59 -0800)
commit8fc610fb15a9b2f70711bf1ee69e3ada81600684
treee4509cfd011a97bdfb263232882d9e2e7b061bd6
parentbd68851f32f584e645093b8072f270a9829ed7c0
ext4: check EA value offset when loading

commit a0626e75954078cfacddb00a4545dde821170bc5 upstream.

When loading extended attributes, check each entry's value offset to
make sure it doesn't collide with the entries.

Without this check it is easy to crash the kernel by mounting a
malicious FS containing a file with an EA wherein e_value_offs = 0 and
e_value_size > 0 and then deleting the EA, which corrupts the name
list.

(See the f_ea_value_crash test's FS image in e2fsprogs for an example.)

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/xattr.c