Linux
nfsd: defer vfree of compound ops to fix rpc_status UAF
In the Linux kernel, the following vulnerability has been resolved: nfsd: defer vfree of compound ops to fix rpc_status UAF The rpc_status netlink dumpit walks every in-flight svc_rqst under rcu_read_lock and, for NFSv4 requests, reads opnums out of args->ops[]. But args->ops is a separate vmalloc buffer freed synchronously by vfree() in nfsd4_release_compoundargs() at the end of every compound. The dumpit's rcu_read_lock pins the svc_rqst struct itself (freed via kfree_rcu), but nothing defers the vfree of the ops buffer across the RCU grace period. A concurrent compound completion can therefore free the buffer while the dumpit is reading it — a use-after-free on vmalloc memory. The trailing seqcount recheck (smp_load_acquire of rq_status_counter) cannot undo a load that already retired against freed memory. Fix by replacing vfree(args->ops) with kvfree_rcu_mightsleep(), which defers the free until after an RCU grace period. This makes the existing rcu_read_lock in the dumpit sufficient to protect the read. The tradeoff is that completed compound ops buffers (up to 200 * sizeof(struct nfsd4_op)) persist in memory slightly longer, across one grace period, before being reclaimed.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- >= bd9d6a3efa9709e653aafbeb859289feccb8e70c, < 48f72aff24f7a7329209dc6cbc27c869f3e3595c
- >= bd9d6a3efa9709e653aafbeb859289feccb8e70c, < 6703199f4d7e7f37d6a726a849eb358e8fae72fb
- >= bd9d6a3efa9709e653aafbeb859289feccb8e70c, < 19413ccc45070a7270b9e25c2a258daf7f91de42
- >= bd9d6a3efa9709e653aafbeb859289feccb8e70c, < fca26a3fc19ed02278aa2a150af82d43db0302cb
Fixed in 48f72aff24f7a7329209dc6cbc27c869f3e3595c, 6703199f4d7e7f37d6a726a849eb358e8fae72fb, 19413ccc45070a7270b9e25c2a258daf7f91de42, fca26a3fc19ed02278aa2a150af82d43db0302cb
- 6.7
Fixed in 0, 6.12.109, 6.18.50, 7.2.4, 7.3
Mitigation
Upgrade Linux to 48f72aff24f7a7329209dc6cbc27c869f3e3595c or 6703199f4d7e7f37d6a726a849eb358e8fae72fb or 19413ccc45070a7270b9e25c2a258daf7f91de42 or fca26a3fc19ed02278aa2a150af82d43db0302cb or later.
Upgrade Linux to 0 or 6.12.109 or 6.18.50 or 7.2.4 or 7.3 or later.
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.