NFSD: Fix READDIR buffer overflow
Summary
| CVE | CVE-2021-47107 |
|---|---|
| State | PUBLISHED |
| Assigner | Linux |
| Source Priority | CVE Program / NVD first with legacy fallback |
| Published | 2024-03-04 19:15:18 UTC |
| Updated | 2026-05-12 10:16:37 UTC |
| Description | In the Linux kernel, the following vulnerability has been resolved: NFSD: Fix READDIR buffer overflow If a client sends a READDIR count argument that is too small (say, zero), then the buffer size calculation in the new init_dirlist helper functions results in an underflow, allowing the XDR stream functions to write beyond the actual buffer. This calculation has always been suspect. NFSD has never sanity- checked the READDIR count argument, but the old entry encoders managed the problem correctly. With the commits below, entry encoding changed, exposing the underflow to the pointer arithmetic in xdr_reserve_space(). Modern NFS clients attempt to retrieve as much data as possible for each READDIR request. Also, we have no unit tests that exercise the behavior of READDIR at the lower bound of @count values. Thus this case was missed during testing. |
Risk And Classification
Primary CVSS: v3.1 7.8 HIGH from [email protected]
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
EPSS: 0.000160000 probability, percentile 0.035280000 (date 2026-05-12)
Problem Types: CWE-120
CVSS v3.1 Breakdown
Attack Vector
LocalAttack Complexity
LowPrivileges Required
LowUser Interaction
NoneScope
UnchangedConfidentiality
HighIntegrity
HighAvailability
HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
NVD Known Affected Configurations (CPE 2.3)
| Type | Vendor | Product | Version | Update | Edition | Language |
|---|---|---|---|---|---|---|
| Operating System | Linux | Linux Kernel | All | All | All | All |
| Operating System | Linux | Linux Kernel | 5.16 | rc1 | All | All |
| Operating System | Linux | Linux Kernel | 5.16 | rc2 | All | All |
| Operating System | Linux | Linux Kernel | 5.16 | rc3 | All | All |
| Operating System | Linux | Linux Kernel | 5.16 | rc4 | All | All |
| Operating System | Linux | Linux Kernel | 5.16 | rc5 | All | All |
| Operating System | Linux | Linux Kernel | 5.16 | rc6 | All | All |
Vendor Declared Affected Products
| Source | Vendor | Product | Version | Platforms |
|---|---|---|---|---|
| CNA | Linux | Linux | affected 37aa5e64022243e721b8334122997881177a4cfc 9e291a6a28d32545ed2fd959a8165144d1724df1 git | Not specified |
| CNA | Linux | Linux | affected 7f87fc2d34d475225e78b7f5c4eabb121f4282b2 eabc0aab98e5218ceecd82069b0d6fdfff5ee885 git | Not specified |
| CNA | Linux | Linux | affected 7f87fc2d34d475225e78b7f5c4eabb121f4282b2 53b1119a6e5028b125f431a0116ba73510d82a72 git | Not specified |
| CNA | Linux | Linux | affected 5.13 | Not specified |
| CNA | Linux | Linux | unaffected 5.13 semver | Not specified |
| CNA | Linux | Linux | unaffected 5.15.12 5.15.* semver | Not specified |
| CNA | Linux | Linux | unaffected 5.16 * original_commit_for_fix | Not specified |
| ADP | Siemens | SIMATIC S7-1500 TM MFP - GNU/Linux Subsystem | affected * custom | Not specified |
References
| Reference | Source | Link | Tags |
|---|---|---|---|
| git.kernel.org/stable/c/53b1119a6e5028b125f431a0116ba73510d82a72 | af854a3a-2127-422b-91ae-364da2661108 | git.kernel.org | Exploit, Mailing List, Patch |
| cert-portal.siemens.com/productcert/html/ssa-265688.html | 0b142b55-0307-4c5a-b3c9-f314f3fb7c5e | cert-portal.siemens.com | |
| git.kernel.org/stable/c/9e291a6a28d32545ed2fd959a8165144d1724df1 | af854a3a-2127-422b-91ae-364da2661108 | git.kernel.org | Exploit, Mailing List, Patch |
| git.kernel.org/stable/c/eabc0aab98e5218ceecd82069b0d6fdfff5ee885 | af854a3a-2127-422b-91ae-364da2661108 | git.kernel.org | Exploit, Mailing List, Patch |
| CVE Program record | CVE.ORG | www.cve.org | canonical |
| NVD vulnerability detail | NVD | nvd.nist.gov | canonical, analysis |
No vendor comments have been submitted for this CVE.
There are currently no legacy QID mappings associated with this CVE.