summaryrefslogtreecommitdiffstats
path: root/fs/ext4
diff options
context:
space:
mode:
authorJan Kara <jack@suse.cz>2016-08-29 15:39:11 -0400
committerTheodore Ts'o <tytso@mit.edu>2016-08-29 15:39:11 -0400
commit2de58f1102cf1ac6091209e1dfa8eccbcb039570 (patch)
tree065c26c641632243b85f4f2f59814534f06eda64 /fs/ext4
parente3014d14a81edde488d9a6758eea8afc41752d2d (diff)
downloadop-kernel-dev-2de58f1102cf1ac6091209e1dfa8eccbcb039570.zip
op-kernel-dev-2de58f1102cf1ac6091209e1dfa8eccbcb039570.tar.gz
ext4: Check that external xattr value block is zero
Currently we don't support xattrs with values stored out of line. Check for that in ext4_xattr_check_names() to make sure we never work with such xattrs since not all the code counts with that resulting is possible weird corruption issues. Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r--fs/ext4/xattr.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
index 22d2ebc..f845cb7 100644
--- a/fs/ext4/xattr.c
+++ b/fs/ext4/xattr.c
@@ -199,6 +199,8 @@ ext4_xattr_check_names(struct ext4_xattr_entry *entry, void *end,
}
while (!IS_LAST_ENTRY(entry)) {
+ if (entry->e_value_block != 0)
+ return -EFSCORRUPTED;
if (entry->e_value_size != 0 &&
(value_start + le16_to_cpu(entry->e_value_offs) <
(void *)e + sizeof(__u32) ||
OpenPOWER on IntegriCloud