SUNRPC: do not retry on EKEYEXPIRED when user TGT ticket expired
authorDai Ngo <dai.ngo@oracle.com>
Wed, 8 Jan 2025 20:48:12 +0000 (12:48 -0800)
committerAnna Schumaker <anna.schumaker@oracle.com>
Wed, 22 Jan 2025 20:53:31 +0000 (15:53 -0500)
commit6f56971841a178e99c502f4150fa28b9d699ed31
tree6a24a1437d7eddd6335a4c6deae623927e53f955
parent918b8e3b3ffda3602a0179b7b9b904f89561c03e
SUNRPC: do not retry on EKEYEXPIRED when user TGT ticket expired

When a user TGT ticket expired, gssd returns EKEYEXPIRED to the RPC
layer for the upcall to create the security context. The RPC layer
then retries the upcall twice before returning the EKEYEXPIRED to
the NFS layer.

This results in three separate TCP connections to the NFS server being
created by gssd for each RPC request. These connections are not used
and left in TIME_WAIT state.

Note that for RPC call that uses machine credential, gssd automatically
renews the ticket. But for a regular user the ticket needs to be
renewed by the user before access to the krb5 share is allowed.

This patch removes the retries by RPC on EKEYEXPIRED so that these
unused TCP connections are not created.

Reproducer:

$ kinit -l 1m
$ sleep 65
$ cd /mnt/krb5share
$ netstat -na |grep TIME_WAIT

Signed-off-by: Dai Ngo <dai.ngo@oracle.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
net/sunrpc/clnt.c