CVE-2025-38347

Source
https://cve.org/CVERecord?id=CVE-2025-38347
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-38347.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-38347
Downstream
Published
2025-07-10T08:15:14.907Z
Modified
2026-05-28T03:54:44.517974175Z
Summary
f2fs: fix to do sanity check on ino and xnid
Details

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

f2fs: fix to do sanity check on ino and xnid

syzbot reported a f2fs bug as below:

INFO: task syz-executor140:5308 blocked for more than 143 seconds. Not tainted 6.14.0-rc7-syzkaller-00069-g81e4f8d68c66 #0 "echo 0 > /proc/sys/kernel/hungtasktimeoutsecs" disables this message. task:syz-executor140 state:D stack:24016 pid:5308 tgid:5308 ppid:5306 taskflags:0x400140 flags:0x00000006 Call Trace: <TASK> context_switch kernel/sched/core.c:5378 [inline] __schedule+0x190e/0x4c90 kernel/sched/core.c:6765 __scheduleloop kernel/sched/core.c:6842 [inline] schedule+0x14b/0x320 kernel/sched/core.c:6857 ioschedule+0x8d/0x110 kernel/sched/core.c:7690 foliowaitbit_common+0x839/0xee0 mm/filemap.c:1317 __foliolock mm/filemap.c:1664 [inline] foliolock include/linux/pagemap.h:1163 [inline] __filemapgetfolio+0x147/0xb40 mm/filemap.c:1917 pagecachegetpage+0x2c/0x130 mm/folio-compat.c:87 findgetpageflags include/linux/pagemap.h:842 [inline] f2fsgrabcachepage+0x2b/0x320 fs/f2fs/f2fs.h:2776 __getnodepage+0x131/0x11b0 fs/f2fs/node.c:1463 read_xattrblock+0xfb/0x190 fs/f2fs/xattr.c:306 lookupallxattrs fs/f2fs/xattr.c:355 [inline] f2fsgetxattr+0x676/0xf70 fs/f2fs/xattr.c:533 __f2fsgetacl+0x52/0x870 fs/f2fs/acl.c:179 f2fsaclcreate fs/f2fs/acl.c:375 [inline] f2fsinitacl+0xd7/0x9b0 fs/f2fs/acl.c:418 f2fsinitinodemetadata+0xa0f/0x1050 fs/f2fs/dir.c:539 f2fsaddinlineentry+0x448/0x860 fs/f2fs/inline.c:666 f2fsadddentry+0xba/0x1e0 fs/f2fs/dir.c:765 f2fsdoaddlink+0x28c/0x3a0 fs/f2fs/dir.c:808 f2fsaddlink fs/f2fs/f2fs.h:3616 [inline] f2fsmknod+0x2e8/0x5b0 fs/f2fs/namei.c:766 vfsmknod+0x36d/0x3b0 fs/namei.c:4191 unixbindbsd net/unix/afunix.c:1286 [inline] unixbind+0x563/0xe30 net/unix/afunix.c:1379 __sysbindsocket net/socket.c:1817 [inline] __sys_bind+0x1e4/0x290 net/socket.c:1848 __dosysbind net/socket.c:1853 [inline] __sesysbind net/socket.c:1851 [inline] __x64sysbind+0x7a/0x90 net/socket.c:1851 dosyscallx64 arch/x86/entry/common.c:52 [inline] dosyscall64+0xf3/0x230 arch/x86/entry/common.c:83 entrySYSCALL64afterhwframe+0x77/0x7f

Let's dump and check metadata of corrupted inode, it shows its xattrnid is the same to its iino.

dump.f2fs -i 3 chaseyu.img.raw ixattrnid [0x 3 : 3]

So that, during mknod in the corrupted directory, it tries to get and lock inode page twice, result in deadlock.

  • f2fs_mknod
    • f2fsaddinlineentry
      • f2fsgetinodepage --- lock dir's inode page
        • f2fsinitacl
          • f2fsaclcreate(dir,..)
            • __f2fsgetacl
              • f2fs_getxattr
                • lookupallxattrs
                  • __getnodepage --- try to lock dir's inode page

In order to fix this, let's add sanity check on ino and xnid.

Database specific
{
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38347.json",
    "cna_assigner": "Linux"
}
References

Affected packages

Git / git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git

Affected ranges

Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
98e4da8ca301e062d79ae168c67e56f3c3de3ce4
Fixed
44e904a1ad09e84039058dcbbb1b9ea5b8d7d75d
Fixed
ecff54aa20b5b21db82e63e46066b55e43d72e78
Fixed
c4029044cc408b149e63db7dc8617a0783a3f10d
Fixed
e98dc1909f3d5bc078ec7a605524f1e3f4c0eb14
Fixed
aaddc6c696bd1bff20eaacfa88579d6eae64d541
Fixed
fed611bd8c7b76b070aa407d0c7558e20d9e1f68
Fixed
5a06d97d5340c00510f24e80e8de821bd3bd9285
Fixed
061cf3a84bde038708eb0f1d065b31b7c2456533

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-38347.json"

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
3.8.0
Fixed
5.4.297
Type
ECOSYSTEM
Events
Introduced
5.5.0
Fixed
5.10.241
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.190
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.149
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.95
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.35
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.15.4

Database specific

source
"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-38347.json"