Lucene search

K
vulnrichmentLinuxVULNRICHMENT:CVE-2021-47107
HistoryMar 04, 2024 - 6:15 p.m.

CVE-2021-47107 NFSD: Fix READDIR buffer overflow

2024-03-0418:15:38
Linux
github.com
6
nfsd
readdir
buffer overflow
linux kernel

AI Score

6.5

Confidence

Low

SSVC

Exploitation

none

Automatable

no

Technical Impact

partial

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.

CNA Affected

[
  {
    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
    "vendor": "Linux",
    "product": "Linux",
    "versions": [
      {
        "status": "affected",
        "version": "37aa5e640222",
        "lessThan": "9e291a6a28d3",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "7f87fc2d34d4",
        "lessThan": "eabc0aab98e5",
        "versionType": "git"
      },
      {
        "status": "affected",
        "version": "7f87fc2d34d4",
        "lessThan": "53b1119a6e50",
        "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": "custom"
      },
      {
        "status": "unaffected",
        "version": "5.15.12",
        "versionType": "custom",
        "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"
  }
]

AI Score

6.5

Confidence

Low

SSVC

Exploitation

none

Automatable

no

Technical Impact

partial