Whamcloud - gitweb
LU-17015 gss: avoid request replay
authorSebastien Buisson <sbuisson@ddn.com>
Fri, 13 Oct 2023 15:19:16 +0000 (17:19 +0200)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 29 Dec 2023 10:53:40 +0000 (10:53 +0000)
commit482f11c18088ba6a0a1b5d6bceebe0187b4041e3
tree77b5c511aae1adbcc61c611e157bd384a9707501
parentc5385ab441bb0a1ad5b2d400f64ae69ccae8de64
LU-17015 gss: avoid request replay

Lustre's upcall cache has a retry mechanism in case the upcall was
interrupted or failed and we timed out waiting. In this case we do our
best to retry and do the upcall again.
But when the upcall cache is used for GSS contexts, the upcall cannot
be done twice with same data. The GSSAPI implements security measures
that forbids that kind of request replay, to prevent man-in-the-middle
attacks for instance.

Add a new uc_acquire_replay field to struct upcall_cache, so that
upcall cache users can tell if acquire upcall can be replayed.
For identity upcall, this replay is fine. But for GSS contexts we need
to avoid those replays.
And bump upcall cache timeout value from 20s to 30s for GSS context
init requests.

Also add more debug messages to gss code for both client and server
sides, and both kernel and userspace.

Lustre-change: https://review.whamcloud.com/52689
Lustre-commit: d0194a4b5f6efa26d5473c2793b525f5fdb77e67

Test-Parameters: kerberos=true testlist=sanity-krb5
Signed-off-by: Sebastien Buisson <sbuisson@ddn.com>
Change-Id: I56decc83a4f0d21be420e87cb0417826011932af
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Aurelien Degremont <adegremont@nvidia.com>
Reviewed-on: https://review.whamcloud.com/c/ex/lustre-release/+/53255
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/include/upcall_cache.h
lustre/mdt/mdt_handler.c
lustre/obdclass/upcall_cache.c
lustre/ptlrpc/gss/gss_cli_upcall.c
lustre/ptlrpc/gss/gss_svc_upcall.c
lustre/utils/gss/lgss_keyring.c
lustre/utils/gss/lgss_utils.c
lustre/utils/gss/lgss_utils.h
lustre/utils/gss/svcgssd_proc.c