CVE-2025-37741

Source
https://nvd.nist.gov/vuln/detail/CVE-2025-37741
Import Source
https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2025-37741.json
JSON Data
https://api.test.osv.dev/v1/vulns/CVE-2025-37741
Downstream
Related
Published
2025-05-01T12:55:49.947Z
Modified
2025-11-27T02:33:37.801876Z
Summary
jfs: Prevent copying of nlink with value 0 from disk inode
Details

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

jfs: Prevent copying of nlink with value 0 from disk inode

syzbot report a deadlock in diFree. [1]

When calling "ioctl$LOOPSETSTATUS64", the offset value passed in is 4, which does not match the mounted loop device, causing the mapping of the mounted loop device to be invalidated.

When creating the directory and creating the inode of iag in diReadSpecial(), read the page of fixed disk inode (AIT) in raw mode in readmetapage(), the metapage data it returns is corrupted, which causes the nlink value of 0 to be assigned to the iag inode when executing copyfrom_dinode(), which ultimately causes a deadlock when entering diFree().

To avoid this, first check the nlink value of dinode before setting iag inode.

[1] WARNING: possible recursive locking detected

6.12.0-rc7-syzkaller-00212-g4a5df3796467 #0 Not tainted

syz-executor301/5309 is trying to acquire lock: ffff888044548920 (&(imap->imaglock[index])){+.+.}-{3:3}, at: diFree+0x37c/0x2fb0 fs/jfs/jfsimap.c:889

but task is already holding lock: ffff888044548920 (&(imap->im_aglock[index])){+.+.}-{3:3}, at: diAlloc+0x1b6/0x1630

other info that might help us debug this: Possible unsafe locking scenario:

   CPU0
   ----

lock(&(imap->imaglock[index])); lock(&(imap->imaglock[index]));

* DEADLOCK *

May be due to missing lock nesting notation

5 locks held by syz-executor301/5309: #0: ffff8880422a4420 (sbwriters#9){.+.+}-{0:0}, at: mntwantwrite+0x3f/0x90 fs/namespace.c:515 #1: ffff88804755b390 (&type->imutexdirkey#6/1){+.+.}-{3:3}, at: inodelocknested include/linux/fs.h:850 [inline] #1: ffff88804755b390 (&type->imutexdirkey#6/1){+.+.}-{3:3}, at: filenamecreate+0x260/0x540 fs/namei.c:4026 #2: ffff888044548920 (&(imap->imaglock[index])){+.+.}-{3:3}, at: diAlloc+0x1b6/0x1630 #3: ffff888044548890 (&imap->imfreelock){+.+.}-{3:3}, at: diNewIAG fs/jfs/jfsimap.c:2460 [inline] #3: ffff888044548890 (&imap->imfreelock){+.+.}-{3:3}, at: diAllocExt fs/jfs/jfsimap.c:1905 [inline] #3: ffff888044548890 (&imap->imfreelock){+.+.}-{3:3}, at: diAllocAG+0x4b7/0x1e50 fs/jfs/jfsimap.c:1669 #4: ffff88804755a618 (&jfsip->rdwrlock/1){++++}-{3:3}, at: diNewIAG fs/jfs/jfsimap.c:2477 [inline] #4: ffff88804755a618 (&jfsip->rdwrlock/1){++++}-{3:3}, at: diAllocExt fs/jfs/jfsimap.c:1905 [inline] #4: ffff88804755a618 (&jfsip->rdwrlock/1){++++}-{3:3}, at: diAllocAG+0x869/0x1e50 fs/jfs/jfs_imap.c:1669

stack backtrace: CPU: 0 UID: 0 PID: 5309 Comm: syz-executor301 Not tainted 6.12.0-rc7-syzkaller-00212-g4a5df3796467 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: <TASK> _dumpstack lib/dumpstack.c:94 [inline] dumpstacklvl+0x241/0x360 lib/dumpstack.c:120 printdeadlockbug+0x483/0x620 kernel/locking/lockdep.c:3037 checkdeadlock kernel/locking/lockdep.c:3089 [inline] validatechain+0x15e2/0x5920 kernel/locking/lockdep.c:3891 _lockacquire+0x1384/0x2050 kernel/locking/lockdep.c:5202 lockacquire+0x1ed/0x550 kernel/locking/lockdep.c:5825 _mutexlockcommon kernel/locking/mutex.c:608 [inline] _mutexlock+0x136/0xd70 kernel/locking/mutex.c:752 diFree+0x37c/0x2fb0 fs/jfs/jfsimap.c:889 jfsevictinode+0x32d/0x440 fs/jfs/inode.c:156 evict+0x4e8/0x9b0 fs/inode.c:725 diFreeSpecial fs/jfs/jfsimap.c:552 [inline] duplicateIXtree+0x3c6/0x550 fs/jfs/jfsimap.c:3022 diNewIAG fs/jfs/jfsimap.c:2597 [inline] diAllocExt fs/jfs/jfsimap.c:1905 [inline] diAllocAG+0x17dc/0x1e50 fs/jfs/jfsimap.c:1669 diAlloc+0x1d2/0x1630 fs/jfs/jfsimap.c:1590 ialloc+0x8f/0x900 fs/jfs/jfsinode.c:56 jfsmkdir+0x1c5/0xba0 fs/jfs/namei.c:225 vfsmkdir+0x2f9/0x4f0 fs/namei.c:4257 domkdirat+0x264/0x3a0 fs/namei.c:4280 _dosysmkdirat fs/namei.c:4295 [inline] _sesysmkdirat fs/namei.c:4293 [inline] _x64sysmkdirat+0x87/0xa0 fs/namei.c:4293 dosyscallx64 arch/x86/en ---truncated---

Database specific
{
    "cna_assigner": "Linux",
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/blob/cc431b3424123d84bcd7afd4de150b33f117a8ef/cves/2025/37xxx/CVE-2025-37741.json"
}
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
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
Fixed
5b2f26d3fba4e9aac314f8bc0963b3fc28c0e456
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
Fixed
8b5ce75f8bd3ddf480cc0a240d7ff5cdea0444f9
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
Fixed
86bfeaa18f9e4615b97f2d613e0fcc4ced196527
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
Fixed
c9541c2bd0edbdbc5c1148a84d3b48dc8d1b8af2
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
Fixed
b3c4884b987e5d8d0ec061a4d52653c4f4b9c37e
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
Fixed
aeb926e605f97857504bdf748f575e40617e2ef9
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
Fixed
994787341358816d91b2fded288ecb7f129f2b27
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
Fixed
a2b560815528ae8e266fca6038bb5585d13aaef4
Type
GIT
Repo
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
Events
Introduced
1da177e4c3f41524e886b7f1b8a0c1fc7321cac2
Fixed
b61e69bb1c049cf507e3c654fa3dc1568231bd07

Linux / Kernel

Package

Name
Kernel

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
5.4.293
Type
ECOSYSTEM
Events
Introduced
5.5.0
Fixed
5.10.237
Type
ECOSYSTEM
Events
Introduced
5.11.0
Fixed
5.15.181
Type
ECOSYSTEM
Events
Introduced
5.16.0
Fixed
6.1.135
Type
ECOSYSTEM
Events
Introduced
6.2.0
Fixed
6.6.88
Type
ECOSYSTEM
Events
Introduced
6.7.0
Fixed
6.12.24
Type
ECOSYSTEM
Events
Introduced
6.13.0
Fixed
6.13.12
Type
ECOSYSTEM
Events
Introduced
6.14.0
Fixed
6.14.3