# CVE-2024-27031: NFS: Fix nfs\_netfs\_issue\_read() xarray locking for writeback interrupt

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; 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:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.23% (percentile 8, 2026-11-26)
- **CWE:** CWE-667
- **Published:** 2024-05-01T12:53:29.362Z
- **Modified:** 2026-06-17T07:19:00.320Z

## Who should check

- Anyone running Linux \>= 000dbe0bec058cbf2ca9e156e4a5584f5158b0f9, \< ad27382f8495f8ef6d2c66c413d756bfd13c0598; \>= 000dbe0bec058cbf2ca9e156e4a5584f5158b0f9, \< 8df1678c021ffeb20ef8a203bd9413f3ed9b0e9a; \>= 000dbe0bec058cbf2ca9e156e4a5584f5158b0f9, \< 8a2e5977cecd3cde6a0e3e86b7b914d00240e5dc; \>= 000dbe0bec058cbf2ca9e156e4a5584f5158b0f9, \< fd5860ab6341506004219b080aea40213b299d2e
- Anyone running Linux 6.4

## Description

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

NFS: Fix nfs\_netfs\_issue\_read() xarray locking for writeback interrupt

The loop inside nfs\_netfs\_issue\_read() currently does not disable
interrupts while iterating through pages in the xarray to submit
for NFS read.  This is not safe though since after taking xa\_lock,
another page in the mapping could be processed for writeback inside
an interrupt, and deadlock can occur.  The fix is simple and clean
if we use xa\_for\_each\_range(), which handles the iteration with RCU
while reducing code complexity.

The problem is easily reproduced with the following test:
 mount -o vers=3,fsc 127.0.0.1:/export /mnt/nfs
 dd if=/dev/zero of=/mnt/nfs/file1.bin bs=4096 count=1
 echo 3 \> /proc/sys/vm/drop\_caches
 dd if=/mnt/nfs/file1.bin of=/dev/null
 umount /mnt/nfs

On the console with a lockdep-enabled kernel a message similar to
the following will be seen:

 ================================
 WARNING: inconsistent lock state
 6.7.0-lockdbg+ \#10 Not tainted
 --------------------------------
 inconsistent {IN-SOFTIRQ-W} -\> {SOFTIRQ-ON-W} usage.
 test5/1708 \[HC0\[0\]:SC0\[0\]:HE1:SE1\] takes:
 ffff888127baa598 (&xa-\>xa\_lock\#4){+.?.}-{3:3}, at:
nfs\_netfs\_issue\_read+0x1b2/0x4b0 \[nfs\]
 {IN-SOFTIRQ-W} state was registered at:
   lock\_acquire+0x144/0x380
   \_raw\_spin\_lock\_irqsave+0x4e/0xa0
   \_\_folio\_end\_writeback+0x17e/0x5c0
   folio\_end\_writeback+0x93/0x1b0
   iomap\_finish\_ioend+0xeb/0x6a0
   blk\_update\_request+0x204/0x7f0
   blk\_mq\_end\_request+0x30/0x1c0
   blk\_complete\_reqs+0x7e/0xa0
   \_\_do\_softirq+0x113/0x544
   \_\_irq\_exit\_rcu+0xfe/0x120
   irq\_exit\_rcu+0xe/0x20
   sysvec\_call\_function\_single+0x6f/0x90
   asm\_sysvec\_call\_function\_single+0x1a/0x20
   pv\_native\_safe\_halt+0xf/0x20
   default\_idle+0x9/0x20
   default\_idle\_call+0x67/0xa0
   do\_idle+0x2b5/0x300
   cpu\_startup\_entry+0x34/0x40
   start\_secondary+0x19d/0x1c0
   secondary\_startup\_64\_no\_verify+0x18f/0x19b
 irq event stamp: 176891
 hardirqs last  enabled at (176891): \[\<ffffffffa67a0be4\>\]
\_raw\_spin\_unlock\_irqrestore+0x44/0x60
 hardirqs last disabled at (176890): \[\<ffffffffa67a0899\>\]
\_raw\_spin\_lock\_irqsave+0x79/0xa0
 softirqs last  enabled at (176646): \[\<ffffffffa515d91e\>\]
\_\_irq\_exit\_rcu+0xfe/0x120
 softirqs last disabled at (176633): \[\<ffffffffa515d91e\>\]
\_\_irq\_exit\_rcu+0xfe/0x120

 other info that might help us debug this:
  Possible unsafe locking scenario:

        CPU0
        ----
   lock(&xa-\>xa\_lock\#4);
   \<Interrupt\>
     lock(&xa-\>xa\_lock\#4);

  \*\*\* DEADLOCK \*\*\*

 2 locks held by test5/1708:
  \#0: ffff888127baa498 (&sb-\>s\_type-\>i\_mutex\_key\#22){++++}-{4:4}, at:
      nfs\_start\_io\_read+0x28/0x90 \[nfs\]
  \#1: ffff888127baa650 (mapping.invalidate\_lock\#3){.+.+}-{4:4}, at:
      page\_cache\_ra\_unbounded+0xa4/0x280

 stack backtrace:
 CPU: 6 PID: 1708 Comm: test5 Kdump: loaded Not tainted 6.7.0-lockdbg+
 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-1.fc39
04/01/2014
 Call Trace:
  dump\_stack\_lvl+0x5b/0x90
  mark\_lock+0xb3f/0xd20
  \_\_lock\_acquire+0x77b/0x3360
  \_raw\_spin\_lock+0x34/0x80
  nfs\_netfs\_issue\_read+0x1b2/0x4b0 \[nfs\]
  netfs\_begin\_read+0x77f/0x980 \[netfs\]
  nfs\_netfs\_readahead+0x45/0x60 \[nfs\]
  nfs\_readahead+0x323/0x5a0 \[nfs\]
  read\_pages+0xf3/0x5c0
  page\_cache\_ra\_unbounded+0x1c8/0x280
  filemap\_get\_pages+0x38c/0xae0
  filemap\_read+0x206/0x5e0
  nfs\_file\_read+0xb7/0x140 \[nfs\]
  vfs\_read+0x2a9/0x460
  ksys\_read+0xb7/0x140

## Affected and fixed versions

- Linux: \>= 000dbe0bec058cbf2ca9e156e4a5584f5158b0f9, \< ad27382f8495f8ef6d2c66c413d756bfd13c0598; \>= 000dbe0bec058cbf2ca9e156e4a5584f5158b0f9, \< 8df1678c021ffeb20ef8a203bd9413f3ed9b0e9a; \>= 000dbe0bec058cbf2ca9e156e4a5584f5158b0f9, \< 8a2e5977cecd3cde6a0e3e86b7b914d00240e5dc; \>= 000dbe0bec058cbf2ca9e156e4a5584f5158b0f9, \< fd5860ab6341506004219b080aea40213b299d2e (cvelist)
- Linux: 6.4 (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-2024-27031. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2024-27031.md
Affected: Linux >= 000dbe0bec058cbf2ca9e156e4a5584f5158b0f9, < ad27382f8495f8ef6d2c66c413d756bfd13c0598; >= 000dbe0bec058cbf2ca9e156e4a5584f5158b0f9, < 8df1678c021ffeb20ef8a203bd9413f3ed9b0e9a; >= 000dbe0bec058cbf2ca9e156e4a5584f5158b0f9, < 8a2e5977cecd3cde6a0e3e86b7b914d00240e5dc; >= 000dbe0bec058cbf2ca9e15…
Fixed in: Linux 8df1678c021ffeb20ef8a203bd9413f3ed9b0e9a, Linux 8a2e5977cecd3cde6a0e3e86b7b914d00240e5dc

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

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

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

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= 000dbe0bec058cbf2ca9e156e4a5584f5158b0f9, \< ad27382f8495f8ef6d2c66c413d756bfd13c0598; \>= 000dbe0bec058cbf2ca9e156e4a5584f5158b0f9, \< 8df1678c021ffeb20ef8a203bd9413f3ed9b0e9a; \>= 000dbe0bec058cbf2ca9e156e4a5584f5158b0f9, \< 8a2e5977cecd3cde6a0e3e86b7b914d00240e5dc; \>= 000dbe0bec058cbf2ca9e156e4a5584f5158b0f9, \< fd5860ab6341506004219b080aea40213b299d2e; Linux 6.4.

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

Yes. Fixed in Linux 8df1678c021ffeb20ef8a203bd9413f3ed9b0e9a, Linux 8a2e5977cecd3cde6a0e3e86b7b914d00240e5dc. No fix listed yet: follow the vendor advisory.

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

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/ad27382f8495f8ef6d2c66c413d756bfd13c0598>
- patch: <https://git.kernel.org/stable/c/8df1678c021ffeb20ef8a203bd9413f3ed9b0e9a>
- patch: <https://git.kernel.org/stable/c/8a2e5977cecd3cde6a0e3e86b7b914d00240e5dc>
- patch: <https://git.kernel.org/stable/c/fd5860ab6341506004219b080aea40213b299d2e>

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

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