# CVE-2025-21721: nilfs2: handle errors that nilfs\_prepare\_chunk() may return

> 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.29% (percentile 15, 2026-11-28)
- **CWE:** CWE-617
- **Published:** 2025-02-27T02:07:29.784Z
- **Modified:** 2026-06-17T08:44:07.117Z

## Who should check

- Anyone running Linux \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< b38c6c260c2415c7f0968871305e7a093daabb4c; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< f70bd2d8ca454e0ed78970f72147ca321dbaa015; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< 607dc724b162f4452dc768865e578c1a509a1c8c; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< 1ee2d454baa361d2964e3e2f2cca9ee3f769d93c; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< 7891ac3b0a5c56f7148af507306308ab841cdc31; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< eddd3176b8c4c83a46ab974574cda7c3dfe09388; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< 481136234dfe96c7f92770829bec6111c7c5f5dd; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< ee70999a988b8abc3490609142f50ebaa8344432
- Anyone running Linux 2.6.30

## Description

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

nilfs2: handle errors that nilfs\_prepare\_chunk() may return

Patch series "nilfs2: fix issues with rename operations".

This series fixes BUG\_ON check failures reported by syzbot around rename
operations, and a minor behavioral issue where the mtime of a child
directory changes when it is renamed instead of moved.


This patch (of 2):

The directory manipulation routines nilfs\_set\_link() and
nilfs\_delete\_entry() rewrite the directory entry in the folio/page
previously read by nilfs\_find\_entry(), so error handling is omitted on the
assumption that nilfs\_prepare\_chunk(), which prepares the buffer for
rewriting, will always succeed for these.  And if an error is returned, it
triggers the legacy BUG\_ON() checks in each routine.

This assumption is wrong, as proven by syzbot: the buffer layer called by
nilfs\_prepare\_chunk() may call nilfs\_get\_block() if necessary, which may
fail due to metadata corruption or other reasons.  This has been there all
along, but improved sanity checks and error handling may have made it more
reproducible in fuzzing tests.

Fix this issue by adding missing error paths in nilfs\_set\_link(),
nilfs\_delete\_entry(), and their caller nilfs\_rename().

## Affected and fixed versions

- Linux: \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< b38c6c260c2415c7f0968871305e7a093daabb4c; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< f70bd2d8ca454e0ed78970f72147ca321dbaa015; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< 607dc724b162f4452dc768865e578c1a509a1c8c; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< 1ee2d454baa361d2964e3e2f2cca9ee3f769d93c; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< 7891ac3b0a5c56f7148af507306308ab841cdc31; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< eddd3176b8c4c83a46ab974574cda7c3dfe09388; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< 481136234dfe96c7f92770829bec6111c7c5f5dd; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< ee70999a988b8abc3490609142f50ebaa8344432 (cvelist)
- Linux: 2.6.30 (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-2025-21721. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2025-21721.md
Affected: Linux >= 2ba466d74ed74f073257f86e61519cb8f8f46184, < b38c6c260c2415c7f0968871305e7a093daabb4c; >= 2ba466d74ed74f073257f86e61519cb8f8f46184, < f70bd2d8ca454e0ed78970f72147ca321dbaa015; >= 2ba466d74ed74f073257f86e61519cb8f8f46184, < 607dc724b162f4452dc768865e578c1a509a1c8c; >= 2ba466d74ed74f073257f86…
Fixed in: Linux 607dc724b162f4452dc768865e578c1a509a1c8c, Linux 1ee2d454baa361d2964e3e2f2cca9ee3f769d93c, Linux 7891ac3b0a5c56f7148af507306308ab841cdc31, Linux 481136234dfe96c7f92770829bec6111c7c5f5dd

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-2025-21721 being exploited?

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

### How serious is CVE-2025-21721?

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

### Which versions are affected by CVE-2025-21721?

Linux \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< b38c6c260c2415c7f0968871305e7a093daabb4c; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< f70bd2d8ca454e0ed78970f72147ca321dbaa015; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< 607dc724b162f4452dc768865e578c1a509a1c8c; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< 1ee2d454baa361d2964e3e2f2cca9ee3f769d93c; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< 7891ac3b0a5c56f7148af507306308ab841cdc31; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< eddd3176b8c4c83a46ab974574cda7c3dfe09388; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< 481136234dfe96c7f92770829bec6111c7c5f5dd; \>= 2ba466d74ed74f073257f86e61519cb8f8f46184, \< ee70999a988b8abc3490609142f50ebaa8344432; Linux 2.6.30.

### Is there a fix for CVE-2025-21721?

Yes. Fixed in Linux 607dc724b162f4452dc768865e578c1a509a1c8c, Linux 1ee2d454baa361d2964e3e2f2cca9ee3f769d93c, Linux 7891ac3b0a5c56f7148af507306308ab841cdc31, Linux 481136234dfe96c7f92770829bec6111c7c5f5dd. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2025-21721?

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/b38c6c260c2415c7f0968871305e7a093daabb4c>
- patch: <https://git.kernel.org/stable/c/f70bd2d8ca454e0ed78970f72147ca321dbaa015>
- patch: <https://git.kernel.org/stable/c/607dc724b162f4452dc768865e578c1a509a1c8c>
- patch: <https://git.kernel.org/stable/c/1ee2d454baa361d2964e3e2f2cca9ee3f769d93c>
- patch: <https://git.kernel.org/stable/c/7891ac3b0a5c56f7148af507306308ab841cdc31>
- patch: <https://git.kernel.org/stable/c/eddd3176b8c4c83a46ab974574cda7c3dfe09388>
- patch: <https://git.kernel.org/stable/c/481136234dfe96c7f92770829bec6111c7c5f5dd>
- patch: <https://git.kernel.org/stable/c/ee70999a988b8abc3490609142f50ebaa8344432>
- other: <https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html>
- other: <https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html>

## 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-2025-21721>

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