# CVE-2024-26868: nfs: fix panic when nfs4\_ff\_layout\_prepare\_ds() fails

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

- **Severity:** HIGH 7.5
- **CVSS:** 7.5 (v3.1, CNA) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Network; Attack complexity: Low; Privileges required: None; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Remote, no login needed
- **EPSS:** 0.85% (percentile 55, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2024-04-17T10:27:29.431Z
- **Modified:** 2026-08-05T11:27:55.702Z

## Who should check

- Anyone running Linux \>= b739a5bd9d9f18cc69dced8db128ef7206e000cd, \< 31db25e3141b20e2a76a9f219eeca52e3cab126c; \>= b739a5bd9d9f18cc69dced8db128ef7206e000cd, \< 7ca651b4ec4a049f5a46a0e5ff921b86b91c47c5; \>= b739a5bd9d9f18cc69dced8db128ef7206e000cd, \< 5ada9016b1217498fad876a3d5b07645cc955608; \>= b739a5bd9d9f18cc69dced8db128ef7206e000cd, \< dac068f164ad05b35e7c0be13f138c3f6adca58f; \>= b739a5bd9d9f18cc69dced8db128ef7206e000cd, \< 719fcafe07c12646691bd62d7f8d94d657fa0766
- Anyone running Linux 6.1

## Description

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

nfs: fix panic when nfs4\_ff\_layout\_prepare\_ds() fails

We've been seeing the following panic in production

BUG: kernel NULL pointer dereference, address: 0000000000000065
PGD 2f485f067 P4D 2f485f067 PUD 2cc5d8067 PMD 0
RIP: 0010:ff\_layout\_cancel\_io+0x3a/0x90 \[nfs\_layout\_flexfiles\]
Call Trace:
 \<TASK\>
 ? \_\_die+0x78/0xc0
 ? page\_fault\_oops+0x286/0x380
 ? \_\_rpc\_execute+0x2c3/0x470 \[sunrpc\]
 ? rpc\_new\_task+0x42/0x1c0 \[sunrpc\]
 ? exc\_page\_fault+0x5d/0x110
 ? asm\_exc\_page\_fault+0x22/0x30
 ? ff\_layout\_free\_layoutreturn+0x110/0x110 \[nfs\_layout\_flexfiles\]
 ? ff\_layout\_cancel\_io+0x3a/0x90 \[nfs\_layout\_flexfiles\]
 ? ff\_layout\_cancel\_io+0x6f/0x90 \[nfs\_layout\_flexfiles\]
 pnfs\_mark\_matching\_lsegs\_return+0x1b0/0x360 \[nfsv4\]
 pnfs\_error\_mark\_layout\_for\_return+0x9e/0x110 \[nfsv4\]
 ? ff\_layout\_send\_layouterror+0x50/0x160 \[nfs\_layout\_flexfiles\]
 nfs4\_ff\_layout\_prepare\_ds+0x11f/0x290 \[nfs\_layout\_flexfiles\]
 ff\_layout\_pg\_init\_write+0xf0/0x1f0 \[nfs\_layout\_flexfiles\]
 \_\_nfs\_pageio\_add\_request+0x154/0x6c0 \[nfs\]
 nfs\_pageio\_add\_request+0x26b/0x380 \[nfs\]
 nfs\_do\_writepage+0x111/0x1e0 \[nfs\]
 nfs\_writepages\_callback+0xf/0x30 \[nfs\]
 write\_cache\_pages+0x17f/0x380
 ? nfs\_pageio\_init\_write+0x50/0x50 \[nfs\]
 ? nfs\_writepages+0x6d/0x210 \[nfs\]
 ? nfs\_writepages+0x6d/0x210 \[nfs\]
 nfs\_writepages+0x125/0x210 \[nfs\]
 do\_writepages+0x67/0x220
 ? generic\_perform\_write+0x14b/0x210
 filemap\_fdatawrite\_wbc+0x5b/0x80
 file\_write\_and\_wait\_range+0x6d/0xc0
 nfs\_file\_fsync+0x81/0x170 \[nfs\]
 ? nfs\_file\_mmap+0x60/0x60 \[nfs\]
 \_\_x64\_sys\_fsync+0x53/0x90
 do\_syscall\_64+0x3d/0x90
 entry\_SYSCALL\_64\_after\_hwframe+0x46/0xb0

Inspecting the core with drgn I was able to pull this

  \>\>\> prog.crashed\_thread().stack\_trace()\[0\]
  \#0 at 0xffffffffa079657a (ff\_layout\_cancel\_io+0x3a/0x84) in ff\_layout\_cancel\_io at fs/nfs/flexfilelayout/flexfilelayout.c:2021:27
  \>\>\> prog.crashed\_thread().stack\_trace()\[0\]\['idx'\]
  (u32)1
  \>\>\> prog.crashed\_thread().stack\_trace()\[0\]\['flseg'\].mirror\_array\[1\].mirror\_ds
  (struct nfs4\_ff\_layout\_ds \*)0xffffffffffffffed

This is clear from the stack trace, we call nfs4\_ff\_layout\_prepare\_ds()
which could error out initializing the mirror\_ds, and then we go to
clean it all up and our check is only for if (!mirror-\>mirror\_ds).  This
is inconsistent with the rest of the users of mirror\_ds, which have

  if (IS\_ERR\_OR\_NULL(mirror\_ds))

to keep from tripping over this exact scenario.  Fix this up in
ff\_layout\_cancel\_io() to make sure we don't panic when we get an error.
I also spot checked all the other instances of checking mirror\_ds and we
appear to be doing the correct checks everywhere, only unconditionally
dereferencing mirror\_ds when we know it would be valid.

## Affected and fixed versions

- Linux: \>= b739a5bd9d9f18cc69dced8db128ef7206e000cd, \< 31db25e3141b20e2a76a9f219eeca52e3cab126c; \>= b739a5bd9d9f18cc69dced8db128ef7206e000cd, \< 7ca651b4ec4a049f5a46a0e5ff921b86b91c47c5; \>= b739a5bd9d9f18cc69dced8db128ef7206e000cd, \< 5ada9016b1217498fad876a3d5b07645cc955608; \>= b739a5bd9d9f18cc69dced8db128ef7206e000cd, \< dac068f164ad05b35e7c0be13f138c3f6adca58f; \>= b739a5bd9d9f18cc69dced8db128ef7206e000cd, \< 719fcafe07c12646691bd62d7f8d94d657fa0766 (cvelist)
- Linux: 6.1 (cvelist)

## Mitigation

- Upgrade Linux to 719fcafe07c12646691bd62d7f8d94d657fa0766 or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2024-26868.md
Affected: Linux >= b739a5bd9d9f18cc69dced8db128ef7206e000cd, < 31db25e3141b20e2a76a9f219eeca52e3cab126c; >= b739a5bd9d9f18cc69dced8db128ef7206e000cd, < 7ca651b4ec4a049f5a46a0e5ff921b86b91c47c5; >= b739a5bd9d9f18cc69dced8db128ef7206e000cd, < 5ada9016b1217498fad876a3d5b07645cc955608; >= b739a5bd9d9f18cc69dced8…
Fixed in: Linux 31db25e3141b20e2a76a9f219eeca52e3cab126c, Linux 7ca651b4ec4a049f5a46a0e5ff921b86b91c47c5, Linux 5ada9016b1217498fad876a3d5b07645cc955608, Linux 719fcafe07c12646691bd62d7f8d94d657fa0766

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-2024-26868 being exploited?

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

### How serious is CVE-2024-26868?

High: CVSS 7.5 (v3.1, scored by CNA). Remote, no login needed.

### Which versions are affected by CVE-2024-26868?

Linux \>= b739a5bd9d9f18cc69dced8db128ef7206e000cd, \< 31db25e3141b20e2a76a9f219eeca52e3cab126c; \>= b739a5bd9d9f18cc69dced8db128ef7206e000cd, \< 7ca651b4ec4a049f5a46a0e5ff921b86b91c47c5; \>= b739a5bd9d9f18cc69dced8db128ef7206e000cd, \< 5ada9016b1217498fad876a3d5b07645cc955608; \>= b739a5bd9d9f18cc69dced8db128ef7206e000cd, \< dac068f164ad05b35e7c0be13f138c3f6adca58f; \>= b739a5bd9d9f18cc69dced8db128ef7206e000cd, \< 719fcafe07c12646691bd62d7f8d94d657fa0766; Linux 6.1.

### Is there a fix for CVE-2024-26868?

Yes. Fixed in Linux 31db25e3141b20e2a76a9f219eeca52e3cab126c, Linux 7ca651b4ec4a049f5a46a0e5ff921b86b91c47c5, Linux 5ada9016b1217498fad876a3d5b07645cc955608, Linux 719fcafe07c12646691bd62d7f8d94d657fa0766. Upgrade Linux to 719fcafe07c12646691bd62d7f8d94d657fa0766 or later.

### How do I check if I'm affected by CVE-2024-26868?

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/31db25e3141b20e2a76a9f219eeca52e3cab126c>
- patch: <https://git.kernel.org/stable/c/7ca651b4ec4a049f5a46a0e5ff921b86b91c47c5>
- patch: <https://git.kernel.org/stable/c/5ada9016b1217498fad876a3d5b07645cc955608>
- patch: <https://git.kernel.org/stable/c/dac068f164ad05b35e7c0be13f138c3f6adca58f>
- patch: <https://git.kernel.org/stable/c/719fcafe07c12646691bd62d7f8d94d657fa0766>

## 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-2024-26868>

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