пятница

[Bug 2173036] Re: Tasks can hang forever when using NFSv4 with the sec=krb5 mount option

Hi Jacob, Jamie, Thanks, Jamie's analysis matches what I measured on the exact kernels: - 6.8.0-149.149~22.04.1 (released Jammy HWE): NFSv4.0, sec=krb5, TCP, with the reply to RENAME/MKDIR/REMOVE held until 2 s after context expiry. In 8/8 trials (RENAME x4, MKDIR x2, REMOVE x2) the server executed the operation once, the client never retransmitted, and the system call did not return (observed for 3-20 minutes): rpcgss_verify_mic reports GSS_S_CONTEXT_EXPIRED, rpc_bad_verifier follows, and the task waits on xprt_pending indefinitely. - 7.0.0-44 with only 9b62ef6d239e reverted: 7/7 trials (RENAME x3, MKDIR x2, REMOVE x2) show the same hang. Unmodified 7.0.0-44 retransmits with a new XID and returns ENOENT/EEXIST (20/20 per operation). So the wrong results in my earlier comment are not a regression introduced by the backport; 9b62ef6d239e turns the hang into a retransmission, and NFSv4.0 then re-executes the operation. I agree the backport should go ahead, since an indefinite hang is worse. The remaining NFSv4.0 re-execution can be tracked separately. I have posted an RFC upstream that lets an in-flight request complete with its original verified reply after context expiry (not yet reviewed): https://lore.kernel.org/linux-nfs/20261123092104.2518133-1-jade04342@gmail.com/T/ I'm happy to test the SRU kernels or share my reproducer. Thanks, Junyoung Im -- You received this bug notification because you are subscribed to linux in Ubuntu. Matching subscriptions: Bgg, Bmail, Nb https://bugs.launchpad.net/bugs/2173036 Title: Tasks can hang forever when using NFSv4 with the sec=krb5 mount option Status in linux package in Ubuntu: Invalid Status in linux source package in Jammy: In Progress Status in linux source package in Noble: In Progress Bug description: [Impact] NFSv3 and v4 clients using a sec=krb5* mount option can run into a situation where the GSS context expires between sending a request and verifying its reply, causing gss_validate() to fail with GSS_S_CONTEXT_EXPIRED. This results in an EACCES error returned from gss_validate(), which behaves differently on Jammy vs Noble: On Jammy 5.15 kernels, this results in an I/O error being returned. On Noble 6.8 kernels (version 6.8.0-98 and later), because commit fadc0f3bb2de ("sunrpc: don't immediately retransmit on seqno miss") was backported without 9b62ef6d239e ("SUNRPC: fix handling expired GSS context"), the client discards the reply, which results in the task issuing the request never seeing that reply and thus hanging indefinitely. [Fix] The fix exists upstream as commit 9b62ef6d239e ("SUNRPC: fix handling expired GSS context"). The fix solves the issue by catching an error caused by an expired auth context and in that scenario, returning EKEYREJECTED, which triggers the caller to obtain new context and retry instead of stalling. This is a clean cherry pick to Noble 6.8 and Jammy 5.15. [Test plan] Run gss-expiry-repro.sh (attached to the Launchpad bug) as root in a Jammy or Noble VM running the -generic kernel. It sets up a KDC, an NFS server and a sec=krb5 NFSv4 client on the same host, limits tickets (and thus GSS contexts) to 3 minutes, and delays NFS replies by 3s so that the request in flight when a context expires is verified by the client after expiry. It then writes to the mount in a loop: sudo ./gss-expiry-repro.sh 600 Without the fix: Jammy: a write fails with EACCES at each context expiry (about every 3 minutes); the script reports "write FAILED" and FAIL. Noble: a write hangs at the first context expiry; the script reports "write HUNG (>60s)" and FAIL. With the fix, the client obtains a new context and every write succeeds across several expiries; the script reports PASS. [Where issues could occur] This modifies the SUNRPC client implementation. Regressions could occur in either it or users of it, including NFSv3 and v4 mounts using Kerberos. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2173036/+subscriptions

Комментариев нет:

Отправить комментарий