Whamcloud - gitweb
LU-17714 gss: cleanup user keyring usage
authorSebastien Buisson <sbuisson@ddn.com>
Mon, 8 Apr 2024 09:06:50 +0000 (11:06 +0200)
committerAndreas Dilger <adilger@whamcloud.com>
Thu, 30 May 2024 00:29:34 +0000 (00:29 +0000)
commit249e441622a5820597cb96a5329f43dafe0c8675
tree15d0f291295710c0fe7b1a07c3ca5e0d806a8b41
parent3af827b903127497916df604041174266110f9ab
LU-17714 gss: cleanup user keyring usage

User keys are linked to the user keyring. But we should not keep an
extra reference on the user keyring for every user key being created.
This leads to too many references on this keyring, and prevents proper
destroy in case the system wants to clean it up (because the user
logged off for instance).
And when unlinking a user key, we need to take care of the user
namespace, in order to fetch the real user keyring, and not the one
associated with the mapped uid in the user namespace.
Finally we must handle the case where the user key is explicitly
revoked via 'keyctl revoke' on the command line, by carrying out the
same cleanup as when 'lfs flushctx' is called. This properly drops
references on the key, and frees the security context associated with
the key.

Lustre-change: https://review.whamcloud.com/54692
Lustre-commit: afe0e091d1b82391a929df74717b9665a6f0ab75

Test-Parameters: kerberos=true testlist=sanity-krb5
Fixes: eef24d8a97 ("LU-17173 gss: user keys go to user keyring")
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: Ic168b68f8652689aa4402eaa4fcdbd852743d320
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/55170
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/ptlrpc/gss/gss_keyring.c