# CVE-2025-38163: f2fs: fix to do sanity check on sbi-\>total\_valid\_block\_count

> 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.30% (percentile 15, 2026-11-28)
- **CWE:** CWE-476
- **Published:** 2025-07-03T08:36:04.397Z
- **Modified:** 2026-06-17T09:16:18.027Z

## Who should check

- Anyone running Linux \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< 49bc7bf38e42cfa642787e947f5721696ea73ac3; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< f1b743c1955151bd392539b739a3ad155296be13; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< 6a324d77f7ea1a91d55c4b6ad970e3ac9ab6a20d; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< 25f3776b58c1c45ad2e50ab4b263505b4d2378ca; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< a39cc43efc1bca74ed9d6cf9e60b995071f7d178; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< 65b3f76592aed5a43c4d79375ac097acf975972b; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< ccc28c0397f75a3ec9539cceed9db014d7b73869; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< 05872a167c2cab80ef186ef23cc34a6776a1a30c
- Anyone running Linux 3.8

## Description

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

f2fs: fix to do sanity check on sbi-\>total\_valid\_block\_count

syzbot reported a f2fs bug as below:

------------\[ cut here \]------------
kernel BUG at fs/f2fs/f2fs.h:2521!
RIP: 0010:dec\_valid\_block\_count+0x3b2/0x3c0 fs/f2fs/f2fs.h:2521
Call Trace:
 f2fs\_truncate\_data\_blocks\_range+0xc8c/0x11a0 fs/f2fs/file.c:695
 truncate\_dnode+0x417/0x740 fs/f2fs/node.c:973
 truncate\_nodes+0x3ec/0xf50 fs/f2fs/node.c:1014
 f2fs\_truncate\_inode\_blocks+0x8e3/0x1370 fs/f2fs/node.c:1197
 f2fs\_do\_truncate\_blocks+0x840/0x12b0 fs/f2fs/file.c:810
 f2fs\_truncate\_blocks+0x10d/0x300 fs/f2fs/file.c:838
 f2fs\_truncate+0x417/0x720 fs/f2fs/file.c:888
 f2fs\_setattr+0xc4f/0x12f0 fs/f2fs/file.c:1112
 notify\_change+0xbca/0xe90 fs/attr.c:552
 do\_truncate+0x222/0x310 fs/open.c:65
 handle\_truncate fs/namei.c:3466 \[inline\]
 do\_open fs/namei.c:3849 \[inline\]
 path\_openat+0x2e4f/0x35d0 fs/namei.c:4004
 do\_filp\_open+0x284/0x4e0 fs/namei.c:4031
 do\_sys\_openat2+0x12b/0x1d0 fs/open.c:1429
 do\_sys\_open fs/open.c:1444 \[inline\]
 \_\_do\_sys\_creat fs/open.c:1522 \[inline\]
 \_\_se\_sys\_creat fs/open.c:1516 \[inline\]
 \_\_x64\_sys\_creat+0x124/0x170 fs/open.c:1516
 do\_syscall\_x64 arch/x86/entry/syscall\_64.c:63 \[inline\]
 do\_syscall\_64+0xf3/0x230 arch/x86/entry/syscall\_64.c:94

The reason is: in fuzzed image, sbi-\>total\_valid\_block\_count is
inconsistent w/ mapped blocks indexed by inode, so, we should
not trigger panic for such case, instead, let's print log and
set fsck flag.

## Affected and fixed versions

- Linux: \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< 49bc7bf38e42cfa642787e947f5721696ea73ac3; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< f1b743c1955151bd392539b739a3ad155296be13; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< 6a324d77f7ea1a91d55c4b6ad970e3ac9ab6a20d; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< 25f3776b58c1c45ad2e50ab4b263505b4d2378ca; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< a39cc43efc1bca74ed9d6cf9e60b995071f7d178; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< 65b3f76592aed5a43c4d79375ac097acf975972b; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< ccc28c0397f75a3ec9539cceed9db014d7b73869; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< 05872a167c2cab80ef186ef23cc34a6776a1a30c (cvelist)
- Linux: 3.8 (cvelist)

## Mitigation

- Upgrade Linux to 05872a167c2cab80ef186ef23cc34a6776a1a30c or later.

## Check your systems with an agent

Paste this into a coding agent:

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

Details: https://flawdb.com/CVE-2025-38163.md
Affected: Linux >= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, < 49bc7bf38e42cfa642787e947f5721696ea73ac3; >= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, < f1b743c1955151bd392539b739a3ad155296be13; >= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, < 6a324d77f7ea1a91d55c4b6ad970e3ac9ab6a20d; >= 39a53e0ce0df01b3cf4bb89…
Fixed in: Linux 49bc7bf38e42cfa642787e947f5721696ea73ac3, Linux 6a324d77f7ea1a91d55c4b6ad970e3ac9ab6a20d, Linux 25f3776b58c1c45ad2e50ab4b263505b4d2378ca, Linux 65b3f76592aed5a43c4d79375ac097acf975972b, Linux 05872a167c2cab80ef186ef23cc34a6776a1a30c

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

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

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

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

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

Linux \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< 49bc7bf38e42cfa642787e947f5721696ea73ac3; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< f1b743c1955151bd392539b739a3ad155296be13; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< 6a324d77f7ea1a91d55c4b6ad970e3ac9ab6a20d; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< 25f3776b58c1c45ad2e50ab4b263505b4d2378ca; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< a39cc43efc1bca74ed9d6cf9e60b995071f7d178; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< 65b3f76592aed5a43c4d79375ac097acf975972b; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< ccc28c0397f75a3ec9539cceed9db014d7b73869; \>= 39a53e0ce0df01b3cf4bb898c7ae2fd2189647d5, \< 05872a167c2cab80ef186ef23cc34a6776a1a30c; Linux 3.8.

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

Yes. Fixed in Linux 49bc7bf38e42cfa642787e947f5721696ea73ac3, Linux 6a324d77f7ea1a91d55c4b6ad970e3ac9ab6a20d, Linux 25f3776b58c1c45ad2e50ab4b263505b4d2378ca, Linux 65b3f76592aed5a43c4d79375ac097acf975972b, Linux 05872a167c2cab80ef186ef23cc34a6776a1a30c. Upgrade Linux to 05872a167c2cab80ef186ef23cc34a6776a1a30c or later.

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

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/49bc7bf38e42cfa642787e947f5721696ea73ac3>
- patch: <https://git.kernel.org/stable/c/f1b743c1955151bd392539b739a3ad155296be13>
- patch: <https://git.kernel.org/stable/c/6a324d77f7ea1a91d55c4b6ad970e3ac9ab6a20d>
- patch: <https://git.kernel.org/stable/c/25f3776b58c1c45ad2e50ab4b263505b4d2378ca>
- patch: <https://git.kernel.org/stable/c/a39cc43efc1bca74ed9d6cf9e60b995071f7d178>
- patch: <https://git.kernel.org/stable/c/65b3f76592aed5a43c4d79375ac097acf975972b>
- patch: <https://git.kernel.org/stable/c/ccc28c0397f75a3ec9539cceed9db014d7b73869>
- patch: <https://git.kernel.org/stable/c/05872a167c2cab80ef186ef23cc34a6776a1a30c>
- other: <https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html>
- other: <https://lists.debian.org/debian-lts-announce/2025/10/msg00007.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-38163>

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