# CVE-2023-54140: nilfs2: fix WARNING in mark\_buffer\_dirty due to discarded buffer reuse

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

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; 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.24% (percentile 9, 2026-11-26)
- **Published:** 2025-12-24T13:06:54.784Z
- **Modified:** 2026-08-05T09:17:35.344Z

## Who should check

- Anyone running Linux \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< 473795610594f261e98920f0945550314df36f07; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< d95e403588738c7ec38f52b9f490b15e7745d393; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< 99a73016a5e12a09586a96f998e91f9ea145cd00; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< f1d637b63d8a27ac3386f186a694907f2717fc13; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< b911bef132a06de01a745c6a24172d6db7216333; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< 4da07e958bfda2d69d83db105780e8916e3ac02e; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< 46c11be2dca295742a5508ea910a77f7733fb7f4; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< b308b3eabc429649b5501d36290cea403fbd746c; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< cdaac8e7e5a059f9b5e816cda257f08d0abffacd
- Anyone running Linux 3.10

## Description

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

nilfs2: fix WARNING in mark\_buffer\_dirty due to discarded buffer reuse

A syzbot stress test using a corrupted disk image reported that
mark\_buffer\_dirty() called from \_\_nilfs\_mark\_inode\_dirty() or
nilfs\_palloc\_commit\_alloc\_entry() may output a kernel warning, and can
panic if the kernel is booted with panic\_on\_warn.

This is because nilfs2 keeps buffer pointers in local structures for some
metadata and reuses them, but such buffers may be forcibly discarded by
nilfs\_clear\_dirty\_page() in some critical situations.

This issue is reported to appear after commit 28a65b49eb53 ("nilfs2: do
not write dirty data after degenerating to read-only"), but the issue has
potentially existed before.

Fix this issue by checking the uptodate flag when attempting to reuse an
internally held buffer, and reloading the metadata instead of reusing the
buffer if the flag was lost.

## Affected and fixed versions

- Linux: \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< 473795610594f261e98920f0945550314df36f07; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< d95e403588738c7ec38f52b9f490b15e7745d393; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< 99a73016a5e12a09586a96f998e91f9ea145cd00; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< f1d637b63d8a27ac3386f186a694907f2717fc13; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< b911bef132a06de01a745c6a24172d6db7216333; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< 4da07e958bfda2d69d83db105780e8916e3ac02e; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< 46c11be2dca295742a5508ea910a77f7733fb7f4; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< b308b3eabc429649b5501d36290cea403fbd746c; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< cdaac8e7e5a059f9b5e816cda257f08d0abffacd (cvelist)
- Linux: 3.10 (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-2023-54140. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2023-54140.md
Affected: Linux >= 8c26c4e2694a163d525976e804d81cd955bbb40c, < 473795610594f261e98920f0945550314df36f07; >= 8c26c4e2694a163d525976e804d81cd955bbb40c, < d95e403588738c7ec38f52b9f490b15e7745d393; >= 8c26c4e2694a163d525976e804d81cd955bbb40c, < 99a73016a5e12a09586a96f998e91f9ea145cd00; >= 8c26c4e2694a163d525976e…
Fixed in: Linux 473795610594f261e98920f0945550314df36f07, Linux 99a73016a5e12a09586a96f998e91f9ea145cd00, Linux 4da07e958bfda2d69d83db105780e8916e3ac02e, Linux 46c11be2dca295742a5508ea910a77f7733fb7f4

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-2023-54140 being exploited?

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

### How serious is CVE-2023-54140?

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

### Which versions are affected by CVE-2023-54140?

Linux \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< 473795610594f261e98920f0945550314df36f07; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< d95e403588738c7ec38f52b9f490b15e7745d393; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< 99a73016a5e12a09586a96f998e91f9ea145cd00; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< f1d637b63d8a27ac3386f186a694907f2717fc13; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< b911bef132a06de01a745c6a24172d6db7216333; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< 4da07e958bfda2d69d83db105780e8916e3ac02e; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< 46c11be2dca295742a5508ea910a77f7733fb7f4; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< b308b3eabc429649b5501d36290cea403fbd746c; \>= 8c26c4e2694a163d525976e804d81cd955bbb40c, \< cdaac8e7e5a059f9b5e816cda257f08d0abffacd; Linux 3.10.

### Is there a fix for CVE-2023-54140?

Yes. Fixed in Linux 473795610594f261e98920f0945550314df36f07, Linux 99a73016a5e12a09586a96f998e91f9ea145cd00, Linux 4da07e958bfda2d69d83db105780e8916e3ac02e, Linux 46c11be2dca295742a5508ea910a77f7733fb7f4. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2023-54140?

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

- other: <https://git.kernel.org/stable/c/473795610594f261e98920f0945550314df36f07>
- other: <https://git.kernel.org/stable/c/d95e403588738c7ec38f52b9f490b15e7745d393>
- other: <https://git.kernel.org/stable/c/99a73016a5e12a09586a96f998e91f9ea145cd00>
- other: <https://git.kernel.org/stable/c/f1d637b63d8a27ac3386f186a694907f2717fc13>
- other: <https://git.kernel.org/stable/c/b911bef132a06de01a745c6a24172d6db7216333>
- other: <https://git.kernel.org/stable/c/4da07e958bfda2d69d83db105780e8916e3ac02e>
- other: <https://git.kernel.org/stable/c/46c11be2dca295742a5508ea910a77f7733fb7f4>
- other: <https://git.kernel.org/stable/c/b308b3eabc429649b5501d36290cea403fbd746c>
- other: <https://git.kernel.org/stable/c/cdaac8e7e5a059f9b5e816cda257f08d0abffacd>

## 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-2023-54140>

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