HomeFreeBSD

nfscl: Acquire a refcount on "cred" for mirrored pNFS RPCs

Description

nfscl: Acquire a refcount on "cred" for mirrored pNFS RPCs

When the NFSv4.1/4.2 client is doing a pnfs mount to
mirrored DS(s), asynchronous threads are used to do the
RPCs against the DS(s) concurrently. If a DS is slow
to reply, it is possible for the "cred" to be free'd
before the asynchronous thread is done with it, causing
a panic/crash.

This patch fixes the problem by acquiring a refcount on
the "cred" while it is being used by the asynchronous thread
for a DS RPC. This bug was found during a recent IETF
NFSv4 testing event.

This bug only affects "pnfs" mounts to mirrored pNFS
servers.

(cherry picked from commit 70910e4b55ca976ca0ad4aa3e34252ba148a6126)

Details

Provenance
rmacklemAuthored on May 3 2022, 2:22 PM
Parents
rG2430388070fc: UFS: clear fs_fmod once more, in the buffer data copy.
Branches
Unknown
Tags
Unknown