# CVE-2021-47506: nfsd: fix use-after-free due to delegation race

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** CRITICAL 9.8
- **CVSS:** 9.8 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.94% (percentile 60, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-05-24T15:01:52.746Z
- **Modified:** 2026-08-05T08:48:10.240Z

## Who should check

- Anyone running Linux \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< 04a8d07f3d58308b92630045560799a3faa3ebce; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< 348714018139c39533c55661a0c7c990671396b4; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< 33645d3e22720cac1e4548f8fef57bf0649536ee; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< 2becaa990b93cbd2928292c0b669d3abb6cf06d4; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< e0759696de6851d7536efddfdd2dfed4c4df1f09; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< eeb0711801f5e19ef654371b627682aed3b11373; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< 148c816f10fd11df27ca6a9b3238cdd42fa72cd3; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< 548ec0805c399c65ed66c6641be467f717833ab5
- Anyone running Linux 3.17

## Description

In the Linux kernel, the following vulnerability has been resolved:

nfsd: fix use-after-free due to delegation race

A delegation break could arrive as soon as we've called vfs\_setlease.  A
delegation break runs a callback which immediately (in
nfsd4\_cb\_recall\_prepare) adds the delegation to del\_recall\_lru.  If we
then exit nfs4\_set\_delegation without hashing the delegation, it will be
freed as soon as the callback is done with it, without ever being
removed from del\_recall\_lru.

Symptoms show up later as use-after-free or list corruption warnings,
usually in the laundromat thread.

I suspect aba2072f4523 "nfsd: grant read delegations to clients holding
writes" made this bug easier to hit, but I looked as far back as v3.0
and it looks to me it already had the same problem.  So I'm not sure
where the bug was introduced; it may have been there from the beginning.

## Affected and fixed versions

- Linux: \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< 04a8d07f3d58308b92630045560799a3faa3ebce; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< 348714018139c39533c55661a0c7c990671396b4; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< 33645d3e22720cac1e4548f8fef57bf0649536ee; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< 2becaa990b93cbd2928292c0b669d3abb6cf06d4; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< e0759696de6851d7536efddfdd2dfed4c4df1f09; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< eeb0711801f5e19ef654371b627682aed3b11373; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< 148c816f10fd11df27ca6a9b3238cdd42fa72cd3; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< 548ec0805c399c65ed66c6641be467f717833ab5 (cvelist)
- Linux: 3.17 (cvelist)

## Mitigation

- Upgrade Linux to 548ec0805c399c65ed66c6641be467f717833ab5 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2021-47506. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2021-47506.md
Affected: Linux >= dff1399f8addf7129c49bb2227469da79cc30b47, < 04a8d07f3d58308b92630045560799a3faa3ebce; >= dff1399f8addf7129c49bb2227469da79cc30b47, < 348714018139c39533c55661a0c7c990671396b4; >= dff1399f8addf7129c49bb2227469da79cc30b47, < 33645d3e22720cac1e4548f8fef57bf0649536ee; >= dff1399f8addf7129c49bb2…
Fixed in: Linux 04a8d07f3d58308b92630045560799a3faa3ebce, Linux 348714018139c39533c55661a0c7c990671396b4, Linux 33645d3e22720cac1e4548f8fef57bf0649536ee, Linux 2becaa990b93cbd2928292c0b669d3abb6cf06d4, Linux 148c816f10fd11df27ca6a9b3238cdd42fa72cd3, Linux 548ec0805c399c65ed66c6641be467f717833ab5

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2021-47506 being exploited?

There is no confirmed exploitation: CVE-2021-47506 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.94% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2021-47506?

Critical: CVSS 9.8 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2021-47506?

Linux \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< 04a8d07f3d58308b92630045560799a3faa3ebce; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< 348714018139c39533c55661a0c7c990671396b4; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< 33645d3e22720cac1e4548f8fef57bf0649536ee; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< 2becaa990b93cbd2928292c0b669d3abb6cf06d4; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< e0759696de6851d7536efddfdd2dfed4c4df1f09; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< eeb0711801f5e19ef654371b627682aed3b11373; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< 148c816f10fd11df27ca6a9b3238cdd42fa72cd3; \>= dff1399f8addf7129c49bb2227469da79cc30b47, \< 548ec0805c399c65ed66c6641be467f717833ab5; Linux 3.17.

### Is there a fix for CVE-2021-47506?

Yes. Fixed in Linux 04a8d07f3d58308b92630045560799a3faa3ebce, Linux 348714018139c39533c55661a0c7c990671396b4, Linux 33645d3e22720cac1e4548f8fef57bf0649536ee, Linux 2becaa990b93cbd2928292c0b669d3abb6cf06d4, Linux 148c816f10fd11df27ca6a9b3238cdd42fa72cd3, Linux 548ec0805c399c65ed66c6641be467f717833ab5. Upgrade Linux to 548ec0805c399c65ed66c6641be467f717833ab5 or later.

### How do I check if I'm affected by CVE-2021-47506?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/04a8d07f3d58308b92630045560799a3faa3ebce>
- patch: <https://git.kernel.org/stable/c/348714018139c39533c55661a0c7c990671396b4>
- patch: <https://git.kernel.org/stable/c/33645d3e22720cac1e4548f8fef57bf0649536ee>
- patch: <https://git.kernel.org/stable/c/2becaa990b93cbd2928292c0b669d3abb6cf06d4>
- patch: <https://git.kernel.org/stable/c/e0759696de6851d7536efddfdd2dfed4c4df1f09>
- patch: <https://git.kernel.org/stable/c/eeb0711801f5e19ef654371b627682aed3b11373>
- patch: <https://git.kernel.org/stable/c/148c816f10fd11df27ca6a9b3238cdd42fa72cd3>
- patch: <https://git.kernel.org/stable/c/548ec0805c399c65ed66c6641be467f717833ab5>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2021-47506>

HTML: <https://flawdb.com/CVE-2021-47506> · JSON: <https://flawdb.com/api/v1/entries/CVE-2021-47506>
