[PATCH 0/2] KEYS: Fix credential handling in lookup_user_key()

Jarkko Sakkinen jarkko at kernel.org
Sun Nov 29 21:41:12 UTC 2026


The commit messages looked a bit too stub so I refined them just a bit
and piggybacked these changes for a sanity check round:

1. Return the user session keyring directly on non-creating
   KEY_SPEC_SESSION_KEYRING lookups instead of mutating task credentials.
2. Reject KEY_LOOKUP_CREATE with -EPERM when subjective credentials are
   overridden, avoiding the BUG_ON() in commit_creds().

Hope this helps with the clarity. They are pushed to my -next mirror
branch but I can still either drop or add more tags. If nothing comes
up, I'll just move forward with the PR.

Link: https://lore.kernel.org/keyrings/CAG48ez0XjVSR=M--UBauTm8sJuc+ZbhKzaPa3a6wrSVHyoKevw@mail.gmail.com/

Cc: keyrings at vger.kernel.org
Cc: linux-doc at vger.kernel.org
Cc: linux-security-module at vger.kernel.org
Cc: David Howells <dhowells at redhat.com>
Cc: Guicai Ma <maguicai at kylinos.cn>
Cc: James Morris <jmorris at namei.org>
Cc: Jann Horn <jannh at google.com>
Cc: Jonathan Corbet <corbet at lwn.net>
Cc: Paul Moore <paul at paul-moore.com>
Cc: Randy Dunlap <rdunlap at infradead.org>
Cc: "Serge E. Hallyn" <serge at hallyn.com>
Cc: Shuah Khan <skhan at linuxfoundation.org>

Jarkko Sakkinen (2):
  KEYS: Return user session keyring on lookup
  KEYS: Reject keyring creation with overridden credentials

 Documentation/security/keys/core.rst |  7 ++--
 security/keys/keyctl.c               |  5 ++-
 security/keys/process_keys.c         | 50 +++++++++-------------------
 3 files changed, 22 insertions(+), 40 deletions(-)


base-commit: 822ba3a89c7896b26e4beb70e2ebffb881924dfe
prerequisite-patch-id: 6b9f0c26cb5c2290d5a2a78c18ccf225b09a6bbb
prerequisite-patch-id: 0f71199bbbbaf9fe1fa82afb1926b452c493532e
prerequisite-patch-id: 97be79eb77addef7282d5cb9966c4208cf0e965e
--
2.47.3




More information about the Linux-security-module-archive mailing list