android_kernel_motorola_sm6375/security
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Amir Goldstein 87ccf6190f
UPSTREAM: selinux: fix inconsistency between inode_getxattr and inode_listsecurity
commit a9ffe682c58aaff643764547f5420e978b6e0830 upstream.

When inode has no listxattr op of its own (e.g. squashfs) vfs_listxattr
calls the LSM inode_listsecurity hooks to list the xattrs that LSMs will
intercept in inode_getxattr hooks.

When selinux LSM is installed but not initialized, it will list the
security.selinux xattr in inode_listsecurity, but will not intercept it
in inode_getxattr.  This results in -ENODATA for a getxattr call for an
xattr returned by listxattr.

This situation was manifested as overlayfs failure to copy up lower
files from squashfs when selinux is built-in but not initialized,
because ovl_copy_xattr() iterates the lower inode xattrs by
vfs_listxattr() and vfs_getxattr().

Match the logic of inode_listsecurity to that of inode_getxattr and
do not list the security.selinux xattr if selinux is not initialized.

Reported-by: Michael Labriola <michael.d.labriola@gmail.com>
Tested-by: Michael Labriola <michael.d.labriola@gmail.com>
Link: https://lore.kernel.org/linux-unionfs/2nv9d47zt7.fsf@aldarion.sourceruckus.org/
Fixes: c8e222616c7e ("selinux: allow reading labels before policy is loaded")
Cc: stable@vger.kernel.org#v5.9+
Change-Id: Ib15d030d97c6579fd20bdad9fbf0c3d0d3c437e4
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Ondrej Mosnacek <omosnace@redhat.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2026-01-14 18:13:16 -08:00
..
apparmor BACKPORT: sysctl: pass kernel pointers to ->proc_handler 2025-12-23 13:36:15 -08:00
bpf UPSTREAM: bpf: Implement bpf_local_storage for inodes 2026-01-14 18:12:21 -08:00
integrity This is the 5.4.291 stable release 2025-03-13 14:53:52 +00:00
keys KEYS: trusted_tpm1: Compare HMAC values in constant time 2025-10-29 14:00:01 +01:00
loadpin
lockdown lockdown: also lock down previous kgdb use 2022-06-06 08:33:48 +02:00
safesetid
selinux UPSTREAM: selinux: fix inconsistency between inode_getxattr and inode_listsecurity 2026-01-14 18:13:16 -08:00
smack This is the 5.4.294 stable release 2025-06-05 07:11:21 +00:00
tomoyo tomoyo: don't emit warning in tomoyo_write_control() 2025-03-13 12:43:03 +01:00
yama BACKPORT: sysctl: pass kernel pointers to ->proc_handler 2025-12-23 13:36:15 -08:00
commoncap.c This is the 5.4.224 stable release 2022-11-16 16:18:17 +00:00
device_cgroup.c device_cgroup: Roll back to original exceptions after copy failure 2023-01-18 11:41:50 +01:00
inode.c securityfs: don't pin dentries twice, once is enough... 2025-08-28 16:21:24 +02:00
Kconfig UPSTREAM: bpf: lsm: Initialize the BPF LSM hooks 2026-01-14 18:12:20 -08:00
Kconfig.hardening ANDROID: kernelci build-break for 64-bit riscv clang builds (5.4 only) 2025-01-31 16:42:47 -08:00
lsm_audit.c
Makefile UPSTREAM: bpf: lsm: Initialize the BPF LSM hooks 2026-01-14 18:12:20 -08:00
min_addr.c BACKPORT: sysctl: pass kernel pointers to ->proc_handler 2025-12-23 13:36:15 -08:00
security.c BACKPORT: security: Refactor declaration of LSM hooks 2025-12-23 13:36:10 -08:00