Skip to content

KEYS: Fix credential handling in lookup_user_key()

Jarkko Sakkinen keyrings linux-doc linux-security-module stable 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 0 repliesNew

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2KEYS: Return user session keyring on lookupDocumentation/security/keys/core.rst security/keys/keyctl.c security/keys/process_keys.c+16 -390 replies
2/2KEYS: Reject keyring creation with overridden credentialsDocumentation/security/keys/core.rst security/keys/process_keys.c+7 -20 replies

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchGuicai Ma
1/2R-b T-b
2/2R-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

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

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.

Cc David Howells <[email protected]>
Cc Guicai Ma <[email protected]>
Cc James Morris <[email protected]>
Cc Jann Horn <[email protected]>
Cc Jonathan Corbet <[email protected]>
Cc Paul Moore <[email protected]>
Cc Randy Dunlap <[email protected]>
Cc "Serge E. Hallyn" <[email protected]>
Cc Shuah Khan <[email protected]>

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