diff options
author | Tahsin Erdogan <tahsin@google.com> | 2017-06-21 22:14:30 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2017-06-21 22:14:30 -0400 |
commit | 7cec191894e4e2200d942415c3ebccb146214d26 (patch) | |
tree | 3d8bed994b49acd4e9afa0e69e3ac4321e1e2670 /fs/ext4 | |
parent | f6109100ba8692c677cfdc88af1887a43263e63a (diff) |
ext4: fix ext4_xattr_cmp()
When a xattr entry refers to an external inode, the value data is not
available in the inline area so we should not attempt to read it using
value offset.
Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'fs/ext4')
-rw-r--r-- | fs/ext4/xattr.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c index bd1e61a0c228..ed27b5241e69 100644 --- a/fs/ext4/xattr.c +++ b/fs/ext4/xattr.c | |||
@@ -2167,7 +2167,8 @@ ext4_xattr_cmp(struct ext4_xattr_header *header1, | |||
2167 | entry1->e_value_inum != entry2->e_value_inum || | 2167 | entry1->e_value_inum != entry2->e_value_inum || |
2168 | memcmp(entry1->e_name, entry2->e_name, entry1->e_name_len)) | 2168 | memcmp(entry1->e_name, entry2->e_name, entry1->e_name_len)) |
2169 | return 1; | 2169 | return 1; |
2170 | if (memcmp((char *)header1 + le16_to_cpu(entry1->e_value_offs), | 2170 | if (!entry1->e_value_inum && |
2171 | memcmp((char *)header1 + le16_to_cpu(entry1->e_value_offs), | ||
2171 | (char *)header2 + le16_to_cpu(entry2->e_value_offs), | 2172 | (char *)header2 + le16_to_cpu(entry2->e_value_offs), |
2172 | le32_to_cpu(entry1->e_value_size))) | 2173 | le32_to_cpu(entry1->e_value_size))) |
2173 | return 1; | 2174 | return 1; |