android_kernel_motorola_sm6375/security/selinux
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Daniel Colascione 43067ac3a3
BACKPORT: selinux: teach SELinux about anonymous inodes
This change uses the anon_inodes and LSM infrastructure introduced in
the previous patches to give SELinux the ability to control
anonymous-inode files that are created using the new
anon_inode_getfd_secure() function.

A SELinux policy author detects and controls these anonymous inodes by
adding a name-based type_transition rule that assigns a new security
type to anonymous-inode files created in some domain. The name used
for the name-based transition is the name associated with the
anonymous inode for file listings --- e.g., "[userfaultfd]" or
"[perf_event]".

Example:

type uffd_t;
type_transition sysadm_t sysadm_t : anon_inode uffd_t "[userfaultfd]";
allow sysadm_t uffd_t:anon_inode { create };

(The next patch in this series is necessary for making userfaultfd
support this new interface.  The example above is just
for exposition.)

Signed-off-by: Daniel Colascione <dancol@google.com>
Signed-off-by: Lokesh Gidra <lokeshgidra@google.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
(cherry picked from commit 29cd6591ab6fee3125ea5c1bf350f5013bc615e1)

Conflicts:
    security/selinux/include/classmap.h
Compile errors:
    security/selinux/hooks.c

(1. Removed 'lockdown' mapping to be in sync with d9cb255af3a03d7b9cdb5ddbab10d9f5c68f97f2)
(2. Replace usage of selinux_initialized() with
selinux_state.initialized)

Signed-off-by: Lokesh Gidra <lokeshgidra@google.com>
Bug: 160737021
Bug: 169683130
Change-Id: I85df2757f121cd7072e91cf3b93c09657bd36b76
2025-02-20 04:17:46 +02:00
..
include BACKPORT: selinux: teach SELinux about anonymous inodes 2025-02-20 04:17:46 +02:00
ss UPSTREAM: selinux: ignore unknown extended permissions 2025-01-16 00:50:13 -08:00
.gitignore
avc.c Merge tag 'ASB-2024-10-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2024-10-09 18:08:17 +00:00
hooks.c BACKPORT: selinux: teach SELinux about anonymous inodes 2025-02-20 04:17:46 +02:00
ibpkey.c
Kconfig
Makefile Merge tag 'ASB-2023-08-05_11-5.4' of https://android.googlesource.com/kernel/common into android13-5.4-lahaina 2023-08-31 18:20:41 +03:00
netif.c
netlabel.c
netlink.c
netnode.c
netport.c
nlmsgtab.c
selinuxfs.c This is the 5.4.285 stable release 2024-11-09 11:29:17 +00:00
xfrm.c