# CVE-2021-47366: afs: Fix corruption in reads at fpos 2G-4G from an OpenAFS server

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

- **Severity:** HIGH 7.1
- **CVSS:** 7.1 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.28% (percentile 13, 2026-11-26)
- **CWE:** CWE-787
- **Published:** 2024-05-21T15:03:33.176Z
- **Modified:** 2026-08-05T08:47:28.087Z

## Who should check

- Anyone running Linux \>= b9b1f8d5930a813879278d0cbfc8c658d6a038dc, \< e66fc460d6dcf85cf12288e133a081205aebcd97; \>= b9b1f8d5930a813879278d0cbfc8c658d6a038dc, \< b537a3c21775075395af475dcc6ef212fcf29db8
- Anyone running Linux 2.6.22

## Description

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

afs: Fix corruption in reads at fpos 2G-4G from an OpenAFS server

AFS-3 has two data fetch RPC variants, FS.FetchData and FS.FetchData64, and
Linux's afs client switches between them when talking to a non-YFS server
if the read size, the file position or the sum of the two have the upper 32
bits set of the 64-bit value.

This is a problem, however, since the file position and length fields of
FS.FetchData are \*signed\* 32-bit values.

Fix this by capturing the capability bits obtained from the fileserver when
it's sent an FS.GetCapabilities RPC, rather than just discarding them, and
then picking out the VICED\_CAPABILITY\_64BITFILES flag.  This can then be
used to decide whether to use FS.FetchData or FS.FetchData64 - and also
FS.StoreData or FS.StoreData64 - rather than using upper\_32\_bits() to
switch on the parameter values.

This capabilities flag could also be used to limit the maximum size of the
file, but all servers must be checked for that.

Note that the issue does not exist with FS.StoreData - that uses \*unsigned\*
32-bit values.  It's also not a problem with Auristor servers as its
YFS.FetchData64 op uses unsigned 64-bit values.

This can be tested by cloning a git repo through an OpenAFS client to an
OpenAFS server and then doing "git status" on it from a Linux afs
client\[1\].  Provided the clone has a pack file that's in the 2G-4G range,
the git status will show errors like:

	error: packfile .git/objects/pack/pack-5e813c51d12b6847bbc0fcd97c2bca66da50079c.pack does not match index
	error: packfile .git/objects/pack/pack-5e813c51d12b6847bbc0fcd97c2bca66da50079c.pack does not match index

This can be observed in the server's FileLog with something like the
following appearing:

Sun Aug 29 19:31:39 2021 SRXAFS\_FetchData, Fid = 2303380852.491776.3263114, Host 192.168.11.201:7001, Id 1001
Sun Aug 29 19:31:39 2021 CheckRights: len=0, for host=192.168.11.201:7001
Sun Aug 29 19:31:39 2021 FetchData\_RXStyle: Pos 18446744071815340032, Len 3154
Sun Aug 29 19:31:39 2021 FetchData\_RXStyle: file size 2400758866
...
Sun Aug 29 19:31:40 2021 SRXAFS\_FetchData returns 5

Note the file position of 18446744071815340032.  This is the requested file
position sign-extended.

## Affected and fixed versions

- Linux: \>= b9b1f8d5930a813879278d0cbfc8c658d6a038dc, \< e66fc460d6dcf85cf12288e133a081205aebcd97; \>= b9b1f8d5930a813879278d0cbfc8c658d6a038dc, \< b537a3c21775075395af475dcc6ef212fcf29db8 (cvelist)
- Linux: 2.6.22 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2021-47366.md
Affected: Linux >= b9b1f8d5930a813879278d0cbfc8c658d6a038dc, < e66fc460d6dcf85cf12288e133a081205aebcd97; >= b9b1f8d5930a813879278d0cbfc8c658d6a038dc, < b537a3c21775075395af475dcc6ef212fcf29db8; Linux 2.6.22
Fixed in: no fixed version listed yet

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-47366 being exploited?

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

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

High: CVSS 7.1 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= b9b1f8d5930a813879278d0cbfc8c658d6a038dc, \< e66fc460d6dcf85cf12288e133a081205aebcd97; \>= b9b1f8d5930a813879278d0cbfc8c658d6a038dc, \< b537a3c21775075395af475dcc6ef212fcf29db8; Linux 2.6.22.

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

No fixed version is listed in the sources yet. No fix listed yet: follow the vendor advisory.

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

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/e66fc460d6dcf85cf12288e133a081205aebcd97>
- patch: <https://git.kernel.org/stable/c/b537a3c21775075395af475dcc6ef212fcf29db8>

## 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-47366>

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