linux/security
Linus Torvalds 2c3418fffa KEYS changes for v7.3-rc7
This pull request contains two critical bug fixes, which can be briefly
 descibed as follows:
 
 1. key_get_persistent() creates a new persisten keyring for UID  if it does
    not exist yet, and creates a link from it to the nominated keyring.
    Function did not set timeout when linking failed, therefore preventing
    GC. The bug was addressed by calling key_set_timeout() regardless of
    key_link() result when the persistent keyring gets created by
    key_get_persistent().
 2. __key_create_or_update() made a copy of keyring->restrict_link before
    holding keyring->sem, which can cause add_key() to be executed against
    stale keyring restrictions. The bug was fixed by copying the value only
    after keyring->sem was taken.
 
 Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYKAB0WIQRE6pSOnaBC00OEHEIaerohdGur0gUCasQmRQAKCRAaerohdGur
 0pa7APwKavlgnkGcbJNLA7kUz+2zt+tI9K/eT/5kgOaelesvmgEA5Xe6gvaXOtjr
 YaxQ2ySKAo4JvTtsPMWgaCn8p2hqVwc=
 =+UWf
 -----END PGP SIGNATURE-----

Merge tag 'keys-v7.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd

Pull keys fixes from Jarkko Sakkinen:

 - key_get_persistent() created a new persistent keyring if one did not
   exist, but failed to set a timeout on it in an error path, preventing
   GC.

   Call key_set_timeout() regardless of key_link() result if a
   persistent keyring was created.

 - __key_create_or_update() made a copy of keyring->restrict_link before
   holding keyring->sem, which could cause add_key() to be executed
   against stale keyring restrictions. Fix it by copying the value only
   after taking keyring->sem

* tag 'keys-v7.3-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd:
  KEYS: Fix add_key() race with keyring restriction
  keys: finalize persistent keyring timeout after link attempt
2026-10-06 04:51:54 +02:00
..
apparmor apparmor: policy_int make sure list heads are initialized before fail path 2026-08-26 00:03:13 -07:00
bpf bpf: Reject BPF_MAP_TYPE_INODE_STORAGE creation if BPF LSM is uninitialized 2026-06-30 16:31:56 +02:00
integrity kmalloc_obj conversions for v7.3-rc2 2026-09-05 20:45:18 -07:00
ipe ipe: protect the dm-verity root hash with RCU 2026-09-25 13:30:27 -07:00
keys KEYS: Fix add_key() race with keyring restriction 2026-10-04 21:09:32 +03:00
landlock landlock: Widen ruleset versions to 64 bits 2026-09-22 20:52:13 +02:00
loadpin Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
lockdown lockdown: move initcalls to the LSM framework 2025-10-22 19:24:27 -04:00
safesetid Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
selinux selinux: preserve NATIVE_LABELS on already-initialized sb in set_mnt_opts 2026-09-30 15:10:41 -04:00
smack Patches for v7.3 2026-08-19 16:51:39 -07:00
tomoyo tomoyo: use u64 for holding inode->i_ino value 2026-04-15 00:00:10 +09:00
yama Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
commoncap_test.c security: Add KUnit tests for kuid_root_in_ns and vfsuid_root_in_currentns 2026-01-09 11:28:28 -06:00
commoncap.c security: Add KUnit tests for kuid_root_in_ns and vfsuid_root_in_currentns 2026-01-09 11:28:28 -06:00
device_cgroup.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
inode.c securityfs: use kstrdup_const() to manage symlink targets 2026-03-17 17:13:36 -04:00
Kconfig proc: make PROC_MEM_FORCE_PTRACE the Kconfig default 2026-04-13 09:12:37 -07:00
Kconfig.hardening hardening: Default randstruct off with rust for better allmodconfig support 2026-09-01 16:01:35 -07:00
lsm_audit.c treewide: change inode->i_ino from unsigned long to u64 2026-03-06 14:31:28 +01:00
lsm_init.c security: lsm: allow LSMs to register for late_initcall_sync init 2026-08-04 12:35:02 -04:00
lsm_notifier.c lsm: split the notifier code out into lsm_notifier.c 2025-10-22 19:24:15 -04:00
lsm_syscalls.c lsm: hold cred_guard_mutex for lsm_set_self_attr() 2026-05-14 16:47:59 -04:00
lsm.h lsm: add backing_file LSM hooks 2026-04-03 16:53:50 -04:00
Makefile lsm: split the init code out into lsm_init.c 2025-10-22 19:24:16 -04:00
min_addr.c lsm: preserve /proc/sys/vm/mmap_min_addr when !CONFIG_SECURITY 2026-01-29 13:56:53 -05:00
security.c lsm: clarify security_task_prctl() hook documentation 2026-07-02 14:59:24 -04:00