Skip to content

Commit 800d0b9

Browse files
stephensmalleybrauner
authored andcommitted
fs/xattr.c: fix simple_xattr_list()
commit 8b0ba61 ("fs/xattr.c: fix simple_xattr_list to always include security.* xattrs") failed to reset err after the call to security_inode_listsecurity(), which returns the length of the returned xattr name. This results in simple_xattr_list() incorrectly returning this length even if a POSIX acl is also set on the inode. Reported-by: Collin Funk <[email protected]> Closes: https://lore.kernel.org/selinux/[email protected]/ Reported-by: Paul Eggert <[email protected]> Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2369561 Fixes: 8b0ba61 ("fs/xattr.c: fix simple_xattr_list to always include security.* xattrs") Signed-off-by: Stephen Smalley <[email protected]> Link: https://lore.kernel.org/[email protected] Signed-off-by: Christian Brauner <[email protected]>
1 parent 714d02b commit 800d0b9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

fs/xattr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,6 +1479,7 @@ ssize_t simple_xattr_list(struct inode *inode, struct simple_xattrs *xattrs,
14791479
buffer += err;
14801480
}
14811481
remaining_size -= err;
1482+
err = 0;
14821483

14831484
read_lock(&xattrs->lock);
14841485
for (rbp = rb_first(&xattrs->rb_root); rbp; rbp = rb_next(rbp)) {

0 commit comments

Comments
 (0)