NFSD: Fix READDIR buffer overflow
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.
CVE-2021-47107
Primary source · Revision 1
Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.
Security context
Source reference: cve:CVE-2021-47107
Linux
Source reference: /containers/cna/affected/0/product
- Affected versions
- Not stated in this record
- Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Linux
Source reference: /containers/cna/affected/1/product
- Affected versions
- Not stated in this record
- Fixed versions
- Not stated in this record
- Prerequisites
- Not stated in this record
Structured affected-version data
Original package identities and version rules from this source.
[
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"product": "Linux",
"versions": [
{
"status": "affected",
"version": "37aa5e64022243e721b8334122997881177a4cfc",
"lessThan": "9e291a6a28d32545ed2fd959a8165144d1724df1",
"versionType": "git"
},
{
"status": "affected",
"version": "7f87fc2d34d475225e78b7f5c4eabb121f4282b2",
"lessThan": "eabc0aab98e5218ceecd82069b0d6fdfff5ee885",
"versionType": "git"
},
{
"status": "affected",
"version": "7f87fc2d34d475225e78b7f5c4eabb121f4282b2",
"lessThan": "53b1119a6e5028b125f431a0116ba73510d82a72",
"versionType": "git"
}
],
"programFiles": [
"fs/nfsd/nfs3proc.c",
"fs/nfsd/nfsproc.c"
],
"defaultStatus": "unaffected"
},
{
"repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
"vendor": "Linux",
"product": "Linux",
"versions": [
{
"status": "affected",
"version": "5.13"
},
{
"status": "unaffected",
"version": "0",
"lessThan": "5.13",
"versionType": "semver"
},
{
"status": "unaffected",
"version": "5.15.12",
"versionType": "semver",
"lessThanOrEqual": "5.15.*"
},
{
"status": "unaffected",
"version": "5.16",
"versionType": "original_commit_for_fix",
"lessThanOrEqual": "*"
}
],
"programFiles": [
"fs/nfsd/nfs3proc.c",
"fs/nfsd/nfsproc.c"
],
"defaultStatus": "affected"
}
]- Related CVEs
- CVE-2021-47107
Source reference:
/cveMetadata/cveId
Publisher severity
critical
Source reference: /containers/cna/metrics
- Event
- #21791 · Revision 1
- Added to Heist Feed
- Publisher date