30 Jul 2025 tags: audit lsm selinux Linux v6.16 was released on Sunday, July 27th, with the Linux v6.17 merge window opening immediately afterwards. Below are the highlights of the LSM, SELinux, and audit pull requests which have been merged into Linus’ tree.
LSM
- Nicolas Bouchinet and Xiu Jianfeng have volunteered to maintain the Lockdown LSM. Unfortunately, the Lockdown LSM had been unmaintained since its original inclusion in Linux v5.4, almost six years ago, and I had growing concerns about its current effectiveness given the lack of care and support. With Lockdown now being actively maintained, I’m hopeful that this situation will improve.
SELinux
-
Add support for a new neveraudit
per-domain flag which prevents all auditing of the associated domain. While there is some overlap with the existing dontaudit
flag, the neveraudit
flag applies to all auditing and when combined with the permissive
domain flag, as one might do for an unconfined domain such as “unconfined_t”, we can perform some significant performance optimizations for certain operations. The optimizations included in Linux v6.17 will be limited to a subset of inode operations, and unlike the path walk optimizations in Linux v6.16, these optimizations will require policy support, therefore the improvements may not be visible on standard Linux distributions for some time.
-
Added a five second delay when using the “/sys/fs/selinux/user” API. This interface was removed from the SELinux userspace tools and libraries in 2020 and marked as deprecated in Linux v6.13. While it is unlikely that any modern Linux distribution shipping a modern Linux kernel and userspace would still be using this API, the five second delay in conjunction with the existing deprecation warning, should help us identify any users which we have not yet been able to reach.
-
Minor changes to the SELinux hash table allocator to quiet allocation failures brought about when loading absurdly large SELinux policies into the kernel. Prior to this change the SELinux kernel code handled these allocation failures gracefully, returning an error, but a warning was displayed on the system’s console in some configurations which was causing problems with some automated test systems, e.g. syzbot. This change simply quiets these allocation failure warnings.
-
Remove some unnecessary cleanup code in the selinuxfs pseudo filesystem implementation.
-
Update the in-kernel SELinux documentation with pointers to additional information in the SELinux project’s GitHub organization.
Audit
- Fix a regression where some failed kernel module load operations were not properly logged by the kernel’s audit subsystem.
29 Jul 2025 tags: audit lsm selinux Linux v6.16 was released on Sunday, July 27th. I already wrote up a post highlighting the LSM, SELinux, and audit changes that were submitted during the merge window. However, there were additional changes that went into Linux v6.16 that are described below.
SELinux
-
Resolve a problem in the SELinux security server code where multiple security IDs were being generated for the same security label during early boot before the SELinux policy is loaded. This should resolve an issue seen by some users of dracut-ng.
-
Quiet a UBSAN warning in the SELinux labeled IPsec allocation code. The allocation itself was correct, but a length variable used to track the size of the allocation had an off-by-one bug which caused UBSAN to believe the buffer was too short.
-
The SELinux DCCP access controls were removed as the Linux kernel no longer supports DCCP.
29 May 2025 tags: audit lsm selinux Linux v6.15 was released on Sunday, May 25th, with the Linux v6.16 merge window opening immediately afterwards. Below are the highlights of the LSM, SELinux, and audit pull requests which have been merged into Linus’ tree.
LSM
- Move the
security_netlink_send()
LSM hook under the Kconfig CONFIG_SECURITY_NETWORK
tunable.
SELinux
-
Reduce the SELinux impact on path walks through the addition of a small directory access cache to the per-task SELinux state. This cache allows SELinux to cache the most recently used directory access decisions in order to avoid repeatedly querying the Access Vector Cache (AVC) on path walks where the majority of the directories have similar security contexts/labels. Crude performance measurements taken prior to this patch indicated that time spent in the SELinux code on a make allmodconfig
run was 103% that of __d_lookup_rcu()
, and with this patch the time spent in the SELinux code dropped to 63% of __d_lookup_rcu()
, a ~40% improvement.
-
Add support for wildcards in genfscon policy statements as opposed to the current prefix matching approach. Adding wilcard support allows for more expressive and efficient path matching in the policy which is especially helpful for filesystems such as sysfs. Early work has shown a ~15% boot time reduction on Android. SELinux policies can opt into wilcard matching by enabling the genfs_seclabel_wildcard
policy capability.
-
Unify the out of memory error handling of the SELinux network and InfiniBand object caches to ensure that cache allocation failures still return the object label and do not fail the operation. While the object label may not be cached in this case, future object lookups will continue to attempt to cache the object’s label.
-
Minor improvements around constification, ‘likely’ annotations, and removal of bogus code comments.
Audit
-
Always record AUDIT_ANOM events when auditing is enabled. Prior to this change AUDIT_ANOM events were only recorded if auditing was enabled and the admin/distro had explicitly configured audit beyond the defaults.
-
Annotate the audit_log_vformat()
function with the __printf()
attribute to quiet warnings on modern GCC compilers.