]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selinux: don't reserve xattr slot when we won't fill it
authorDavid Windsor <dwindsor@gmail.com>
Sun, 26 Apr 2026 23:23:49 +0000 (19:23 -0400)
committerPaul Moore <paul@paul-moore.com>
Mon, 27 Apr 2026 23:32:56 +0000 (19:32 -0400)
commit1e5a8eed7821e7a43a31b4c1b3675a91be6bc6f6
tree46cfafaa9dfad1d7873afc3c34000f05382cd40f
parent032e70aff025d7c519af9ab791cd084380619263
selinux: don't reserve xattr slot when we won't fill it

Move lsm_get_xattr_slot() below the SBLABEL_MNT check so we don't leave
a NULL-named slot in the array when returning -EOPNOTSUPP; filesystem
initxattrs() callbacks stop iterating at the first NULL ->name, silently
dropping xattrs installed by later LSMs.

Cc: stable@vger.kernel.org
Signed-off-by: David Windsor <dwindsor@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/selinux/hooks.c