aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ext2/xattr.c
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2005-02-04 23:09:11 -0800
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-02-04 23:09:11 -0800
commitc2a7650d5a40ea33c06b6f501e1c52b14b51bf83 (patch)
tree989faf1b92628e2464c2234a06a100ab30209b64 /fs/ext2/xattr.c
parent315cbe5938bd3c310085df2ac0ea32324d08c239 (diff)
downloadhistory-c2a7650d5a40ea33c06b6f501e1c52b14b51bf83.tar.gz
[PATCH] Long-standing xattr sharing bug
When looking for identical xattr blocks to share, we were not comparing the name_index fields. This could lead to false sharing when two xattr blocks ended up with identical attribute names and values, and the only default acls. Because acls are cached, the bug was hidden until the next reload of the affected inode. $ mkdir -m 700 a b $ setfacl -m u:bin:rwx a < acl of a goes in the mbcache $ setfacl -dm u:bin:rwx b < acl of b differs only in name_index, so a's acl is reused $ getfacl b < shows the result from the inode cache < empty inode cache (remount, etc.) $ getfacl b < shows an access acl instead of a default acl. Signed-off-by: Andreas Gruenbacher <agruen@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/ext2/xattr.c')
-rw-r--r--fs/ext2/xattr.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ext2/xattr.c b/fs/ext2/xattr.c
index 39186bfd9bb9f5..27982b500e84a9 100644
--- a/fs/ext2/xattr.c
+++ b/fs/ext2/xattr.c
@@ -881,6 +881,7 @@ ext2_xattr_cmp(struct ext2_xattr_header *header1,
if (IS_LAST_ENTRY(entry2))
return 1;
if (entry1->e_hash != entry2->e_hash ||
+ entry1->e_name_index != entry2->e_name_index ||
entry1->e_name_len != entry2->e_name_len ||
entry1->e_value_size != entry2->e_value_size ||
memcmp(entry1->e_name, entry2->e_name, entry1->e_name_len))