ext2: Strengthen xattr block checks
authorJan Kara <jack@suse.cz>
Wed, 15 May 2019 13:39:42 +0000 (15:39 +0200)
committerJan Kara <jack@suse.cz>
Mon, 20 May 2019 08:50:48 +0000 (10:50 +0200)
commit6c71b489ecfd927966571348f4e4135169a9fbd5
treec032d4200b8022641cea1d5c19e616545c24cd5f
parent8cd0f2ba787a1a1758dbe063fe6a26ceccd37c24
ext2: Strengthen xattr block checks

Check every entry in xattr block for validity in ext2_xattr_set() to
detect on disk corruption early. Also since e_value_block field in xattr
entry is never != 0 in a valid filesystem, just remove checks for it
once we have established entries are valid.

Reviewed-by: Chengguang Xu <cgxu519@zoho.com.cn>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/ext2/xattr.c