# CVE-2025-23130: f2fs: fix to avoid panic once fallocation fails for pinfile

- Priority: **Routine**
- Reason: Not severe (CVSS 5.5, local access); no exploitation reported by the 5 checked sources
- Next step: Fix in the normal cadence
- Status: published
- Published: 2025-04-16 · Modified: 2026-05-11
- Aliases: UBUNTU-CVE-2025-23130, DEBIAN-CVE-2025-23130, CGA-3jmx-p4qr-qgm2, CGA-4hxh-22jr-p93f, CGA-5h7w-gr8r-qg39, CGA-5p6h-j38r-8rr9, CGA-6p8h-59jc-4p28, CGA-72c5-r946-wpcg, CGA-7cfc-w734-cvc8, CGA-7mm8-h9ch-rpgj, CGA-827c-6gfp-f78q, CGA-83pj-xvq5-x2m9, CGA-8qgw-5xgh-2hmh, CGA-9fxf-vrjh-rj5p, CGA-9q67-5fpg-27xv, CGA-c4v4-gx33-3m4c, CGA-ffm8-j549-8fcc, CGA-fp9w-62gj-8q52, CGA-g549-v725-73pj, CGA-ggpc-44gq-588v, CGA-ggvf-9vqg-62p9, CGA-h66g-4phr-h73p, CGA-h845-43wq-m45g, CGA-hh4q-gr2x-62j8, CGA-m2h2-w9f8-3hmj, CGA-mh7h-wxw3-3x5x, CGA-p83w-x93j-9rr2, CGA-p8p3-2524-xvp4, CGA-phjh-25mr-h93g, CGA-phjh-r3x8-pxf3, CGA-rh25-34w7-g693, CGA-v3jf-pcmm-h5wx, CGA-wmr9-5xr4-hwq7, CGA-xh6x-x2w3-c8m4
- Record: https://cvemate.com/vulnerability/CVE-2025-23130 · JSON: https://cvemate.com/vulnerability/CVE-2025-23130/json

## Description

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

f2fs: fix to avoid panic once fallocation fails for pinfile

syzbot reports a f2fs bug as below:

------------[ cut here ]------------
kernel BUG at fs/f2fs/segment.c:2746!
CPU: 0 UID: 0 PID: 5323 Comm: syz.0.0 Not tainted 6.13.0-rc2-syzkaller-00018-g7cb1b4663150 #0
RIP: 0010:get_new_segment fs/f2fs/segment.c:2746 [inline]
RIP: 0010:new_curseg+0x1f52/0x1f70 fs/f2fs/segment.c:2876
Call Trace:
 <TASK>
 __allocate_new_segment+0x1ce/0x940 fs/f2fs/segment.c:3210
 f2fs_allocate_new_section fs/f2fs/segment.c:3224 [inline]
 f2fs_allocate_pinning_section+0xfa/0x4e0 fs/f2fs/segment.c:3238
 f2fs_expand_inode_data+0x696/0xca0 fs/f2fs/file.c:1830
 f2fs_fallocate+0x537/0xa10 fs/f2fs/file.c:1940
 vfs_fallocate+0x569/0x6e0 fs/open.c:327
 do_vfs_ioctl+0x258c/0x2e40 fs/ioctl.c:885
 __do_sys_ioctl fs/ioctl.c:904 [inline]
 __se_sys_ioctl+0x80/0x170 fs/ioctl.c:892
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Concurrent pinfile allocation may run out of free section, result in
panic in get_new_segment(), let's expand pin_sem lock coverage to
include f2fs_gc(), so that we can make sure to reclaim enough free
space for following allocation.

In addition, do below changes to enhance error path handling:
- call f2fs_bug_on() only in non-pinfile allocation path in
get_new_segment().
- call reset_curseg_fields() to reset all fields of curseg in
new_curseg()
```

## Signals

- CVSS: 5.5 medium (v3.1, NVD) CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
- EPSS: 0.191%, percentile 9.166%, as of 2026-12-04
- Known exploited (KEV): CISA not listed, ENISA not listed, CIRCL not listed
- Ransomware use: none recorded
- Public exploits: 0

## Affected (first 20 of 159)

- chainguard hyperv-daemons-6.12 (Chainguard): \< 6.12.58-r0
- chainguard linux-aws-6.12 (Chainguard): \< 6.12.57-r2 \| \< 6.12.58-r0
- chainguard linux-aws-6.12-boot-installed (Chainguard): \< 6.12.58-r0
- chainguard linux-aws-6.12-fips-boot-installed (Chainguard): \< 6.12.58-r0
- chainguard linux-aws-6.12-headers (Chainguard): \< 6.12.58-r0
- chainguard linux-aws-6.12-modules (Chainguard): \< 6.12.58-r0
- chainguard linux-azure-6.12 (Chainguard): \< 6.12.57-r2 \| \< 6.12.58-r0
- chainguard linux-azure-6.12-boot-installed (Chainguard): \< 6.12.58-r0
- chainguard linux-azure-6.12-fips-boot-installed (Chainguard): \< 6.12.58-r0
- chainguard linux-azure-6.12-headers (Chainguard): \< 6.12.58-r0
- chainguard linux-azure-6.12-modules (Chainguard): \< 6.12.58-r0
- chainguard linux-gcp-6.12 (Chainguard): \< 6.12.57-r2 \| \< 6.12.58-r0
- chainguard linux-gcp-6.12-boot-installed (Chainguard): \< 6.12.58-r0
- chainguard linux-gcp-6.12-fips-boot-installed (Chainguard): \< 6.12.58-r0
- chainguard linux-gcp-6.12-headers (Chainguard): \< 6.12.58-r0
- chainguard linux-gcp-6.12-modules (Chainguard): \< 6.12.58-r0
- debian linux (Debian): All versions (No fix recorded) \| \< 6.12.57-1 \| \< 6.16.3-1
- ubuntu linux (Ubuntu): All versions (No fix recorded) \| \< 6.8.0-106.106
- ubuntu linux-allwinner-5.19 (Ubuntu): All versions (No fix recorded)
- ubuntu linux-aws (Ubuntu): All versions (No fix recorded) \| \< 6.8.0-1050.53

## References

- <https://git.kernel.org/stable/c/2dda0930fb79b847b4bfceb737577d0f6bc24d7d>
- <https://git.kernel.org/stable/c/9392862608d081a8346a3b841f862d732fce954b>
- <https://git.kernel.org/stable/c/48ea8b200414ac69ea96f4c231f5c7ef1fbeffef>
- <https://ubuntu.com/security/CVE-2025-23130>
- <https://www.cve.org/CVERecord?id=CVE-2025-23130>
- <https://git.kernel.org/linus/48ea8b200414ac69ea96f4c231f5c7ef1fbeffef>
- <https://ubuntu.com/security/notices/USN-7594-1>
- <https://ubuntu.com/security/notices/USN-7594-2>
- <https://ubuntu.com/security/notices/USN-7594-3>
- <https://ubuntu.com/security/notices/USN-8095-1>
- <https://ubuntu.com/security/notices/USN-8100-1>
- <https://ubuntu.com/security/notices/USN-8095-2>
- <https://ubuntu.com/security/notices/USN-8095-3>
- <https://ubuntu.com/security/notices/USN-8095-4>
- <https://ubuntu.com/security/notices/USN-8125-1>
- <https://ubuntu.com/security/notices/USN-8126-1>
- <https://ubuntu.com/security/notices/USN-8095-5>
- <https://ubuntu.com/security/notices/USN-8165-1>
- <https://ubuntu.com/security/notices/USN-8261-1>
- <https://security-tracker.debian.org/tracker/CVE-2025-23130>

---

Data as of 2026-12-05T04:47:45.917Z. The priority label is CveMate's own model from public evidence, not an official rating, and it knows nothing about your assets. How labels are decided: https://cvemate.com/faq#priority
