ext4: check if in-inode xattr is corrupted in ext4_expand_extra_isize_ea()
authorTheodore Ts'o <tytso@mit.edu>
Tue, 22 Mar 2016 20:13:15 +0000 (16:13 -0400)
committerJiri Slaby <jslaby@suse.cz>
Tue, 9 May 2017 06:19:50 +0000 (08:19 +0200)
commit2021b2605e8a25a1683f9c62012c835b83c9af5f
tree679a012766d37e4fe93ba53dba14aa33f3cf6d85
parentdafd35deb3caa7f312b37d815302b959d427a9a2
ext4: check if in-inode xattr is corrupted in ext4_expand_extra_isize_ea()

commit 9e92f48c34eb2b9af9d12f892e2fe1fce5e8ce35 upstream.

We aren't checking to see if the in-inode extended attribute is
corrupted before we try to expand the inode's extra isize fields.

This can lead to potential crashes caused by the BUG_ON() check in
ext4_xattr_shift_entries().

[js] use EIO instead of undefined EFSCORRUPTED in 3.12

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/ext4/xattr.c