Unverified Commit 800d0b9b authored by Stephen Smalley's avatar Stephen Smalley Committed by Christian Brauner
Browse files

fs/xattr.c: fix simple_xattr_list()



commit 8b0ba61d ("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: default avatarCollin Funk <collin.funk1@gmail.com>
Closes: https://lore.kernel.org/selinux/8734ceal7q.fsf@gmail.com/


Reported-by: default avatarPaul Eggert <eggert@cs.ucla.edu>
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2369561


Fixes: 8b0ba61d ("fs/xattr.c: fix simple_xattr_list to always include security.* xattrs")

Signed-off-by: default avatarStephen Smalley <stephen.smalley.work@gmail.com>
Link: https://lore.kernel.org/20250605165116.2063-1-stephen.smalley.work@gmail.com


Signed-off-by: default avatarChristian Brauner <brauner@kernel.org>
parent 714d02b4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1479,6 +1479,7 @@ ssize_t simple_xattr_list(struct inode *inode, struct simple_xattrs *xattrs,
		buffer += err;
	}
	remaining_size -= err;
	err = 0;

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