Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7cec1918 authored by Tahsin Erdogan's avatar Tahsin Erdogan Committed by Theodore Ts'o
Browse files

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: default avatarTahsin Erdogan <tahsin@google.com>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent f6109100
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -2167,7 +2167,8 @@ ext4_xattr_cmp(struct ext4_xattr_header *header1,
		    entry1->e_value_inum != entry2->e_value_inum ||
		    memcmp(entry1->e_name, entry2->e_name, entry1->e_name_len))
			return 1;
		if (memcmp((char *)header1 + le16_to_cpu(entry1->e_value_offs),
		if (!entry1->e_value_inum &&
		    memcmp((char *)header1 + le16_to_cpu(entry1->e_value_offs),
			   (char *)header2 + le16_to_cpu(entry2->e_value_offs),
			   le32_to_cpu(entry1->e_value_size)))
			return 1;