CVE-2025-37741
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
01/05/2025
Last modified:
04/11/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
jfs: Prevent copying of nlink with value 0 from disk inode<br />
<br />
syzbot report a deadlock in diFree. [1]<br />
<br />
When calling "ioctl$LOOP_SET_STATUS64", the offset value passed in is 4,<br />
which does not match the mounted loop device, causing the mapping of the<br />
mounted loop device to be invalidated.<br />
<br />
When creating the directory and creating the inode of iag in diReadSpecial(),<br />
read the page of fixed disk inode (AIT) in raw mode in read_metapage(), the<br />
metapage data it returns is corrupted, which causes the nlink value of 0 to be<br />
assigned to the iag inode when executing copy_from_dinode(), which ultimately<br />
causes a deadlock when entering diFree().<br />
<br />
To avoid this, first check the nlink value of dinode before setting iag inode.<br />
<br />
[1]<br />
WARNING: possible recursive locking detected<br />
6.12.0-rc7-syzkaller-00212-g4a5df3796467 #0 Not tainted<br />
--------------------------------------------<br />
syz-executor301/5309 is trying to acquire lock:<br />
ffff888044548920 (&(imap->im_aglock[index])){+.+.}-{3:3}, at: diFree+0x37c/0x2fb0 fs/jfs/jfs_imap.c:889<br />
<br />
but task is already holding lock:<br />
ffff888044548920 (&(imap->im_aglock[index])){+.+.}-{3:3}, at: diAlloc+0x1b6/0x1630<br />
<br />
other info that might help us debug this:<br />
Possible unsafe locking scenario:<br />
<br />
CPU0<br />
----<br />
lock(&(imap->im_aglock[index]));<br />
lock(&(imap->im_aglock[index]));<br />
<br />
*** DEADLOCK ***<br />
<br />
May be due to missing lock nesting notation<br />
<br />
5 locks held by syz-executor301/5309:<br />
#0: ffff8880422a4420 (sb_writers#9){.+.+}-{0:0}, at: mnt_want_write+0x3f/0x90 fs/namespace.c:515<br />
#1: ffff88804755b390 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: inode_lock_nested include/linux/fs.h:850 [inline]<br />
#1: ffff88804755b390 (&type->i_mutex_dir_key#6/1){+.+.}-{3:3}, at: filename_create+0x260/0x540 fs/namei.c:4026<br />
#2: ffff888044548920 (&(imap->im_aglock[index])){+.+.}-{3:3}, at: diAlloc+0x1b6/0x1630<br />
#3: ffff888044548890 (&imap->im_freelock){+.+.}-{3:3}, at: diNewIAG fs/jfs/jfs_imap.c:2460 [inline]<br />
#3: ffff888044548890 (&imap->im_freelock){+.+.}-{3:3}, at: diAllocExt fs/jfs/jfs_imap.c:1905 [inline]<br />
#3: ffff888044548890 (&imap->im_freelock){+.+.}-{3:3}, at: diAllocAG+0x4b7/0x1e50 fs/jfs/jfs_imap.c:1669<br />
#4: ffff88804755a618 (&jfs_ip->rdwrlock/1){++++}-{3:3}, at: diNewIAG fs/jfs/jfs_imap.c:2477 [inline]<br />
#4: ffff88804755a618 (&jfs_ip->rdwrlock/1){++++}-{3:3}, at: diAllocExt fs/jfs/jfs_imap.c:1905 [inline]<br />
#4: ffff88804755a618 (&jfs_ip->rdwrlock/1){++++}-{3:3}, at: diAllocAG+0x869/0x1e50 fs/jfs/jfs_imap.c:1669<br />
<br />
stack backtrace:<br />
CPU: 0 UID: 0 PID: 5309 Comm: syz-executor301 Not tainted 6.12.0-rc7-syzkaller-00212-g4a5df3796467 #0<br />
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014<br />
Call Trace:<br />
<br />
__dump_stack lib/dump_stack.c:94 [inline]<br />
dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120<br />
print_deadlock_bug+0x483/0x620 kernel/locking/lockdep.c:3037<br />
check_deadlock kernel/locking/lockdep.c:3089 [inline]<br />
validate_chain+0x15e2/0x5920 kernel/locking/lockdep.c:3891<br />
__lock_acquire+0x1384/0x2050 kernel/locking/lockdep.c:5202<br />
lock_acquire+0x1ed/0x550 kernel/locking/lockdep.c:5825<br />
__mutex_lock_common kernel/locking/mutex.c:608 [inline]<br />
__mutex_lock+0x136/0xd70 kernel/locking/mutex.c:752<br />
diFree+0x37c/0x2fb0 fs/jfs/jfs_imap.c:889<br />
jfs_evict_inode+0x32d/0x440 fs/jfs/inode.c:156<br />
evict+0x4e8/0x9b0 fs/inode.c:725<br />
diFreeSpecial fs/jfs/jfs_imap.c:552 [inline]<br />
duplicateIXtree+0x3c6/0x550 fs/jfs/jfs_imap.c:3022<br />
diNewIAG fs/jfs/jfs_imap.c:2597 [inline]<br />
diAllocExt fs/jfs/jfs_imap.c:1905 [inline]<br />
diAllocAG+0x17dc/0x1e50 fs/jfs/jfs_imap.c:1669<br />
diAlloc+0x1d2/0x1630 fs/jfs/jfs_imap.c:1590<br />
ialloc+0x8f/0x900 fs/jfs/jfs_inode.c:56<br />
jfs_mkdir+0x1c5/0xba0 fs/jfs/namei.c:225<br />
vfs_mkdir+0x2f9/0x4f0 fs/namei.c:4257<br />
do_mkdirat+0x264/0x3a0 fs/namei.c:4280<br />
__do_sys_mkdirat fs/namei.c:4295 [inline]<br />
__se_sys_mkdirat fs/namei.c:4293 [inline]<br />
__x64_sys_mkdirat+0x87/0xa0 fs/namei.c:4293<br />
do_syscall_x64 arch/x86/en<br />
---truncated---
Impact
Base Score 3.x
5.50
Severity 3.x
MEDIUM
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.4.293 (excluding) | |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.5 (including) | 5.10.237 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.11 (including) | 5.15.181 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.16 (including) | 6.1.135 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.2 (including) | 6.6.88 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.7 (including) | 6.12.24 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.13 (including) | 6.13.12 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 6.14 (including) | 6.14.3 (excluding) |
| cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:* |
To consult the complete list of CPE names with products and versions, see this page
References to Advisories, Solutions, and Tools
- https://git.kernel.org/stable/c/5b2f26d3fba4e9aac314f8bc0963b3fc28c0e456
- https://git.kernel.org/stable/c/86bfeaa18f9e4615b97f2d613e0fcc4ced196527
- https://git.kernel.org/stable/c/8b5ce75f8bd3ddf480cc0a240d7ff5cdea0444f9
- https://git.kernel.org/stable/c/994787341358816d91b2fded288ecb7f129f2b27
- https://git.kernel.org/stable/c/a2b560815528ae8e266fca6038bb5585d13aaef4
- https://git.kernel.org/stable/c/aeb926e605f97857504bdf748f575e40617e2ef9
- https://git.kernel.org/stable/c/b3c4884b987e5d8d0ec061a4d52653c4f4b9c37e
- https://git.kernel.org/stable/c/b61e69bb1c049cf507e3c654fa3dc1568231bd07
- https://git.kernel.org/stable/c/c9541c2bd0edbdbc5c1148a84d3b48dc8d1b8af2
- https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html
- https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html



