Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5808D2FE300 for ; Fri, 4 Jul 2025 13:42:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751636579; cv=none; b=exVq2IR9n2+7zknXANaKsVHmnfSahx5jYBWhk+my1bERoGvA67GADpmy1R7z2dUpWEey+3XXPsW50/rirZKthx7Sh31AmhJXZcOE6DhDVKxU8uI4QS4fBpS/ye1sUSKcM/Wc9Nteqyx81BlHHMiospfWknKmZnM9xBUXnizzCZY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751636579; c=relaxed/simple; bh=BRkKjHraMotXhhJEgObX7sQONrROrPsZVSsxqUkY/JA=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=Cpcvfq/k1hPD3GhaXzVM98kwNf/HaimR3RkInaNHdwgOqGEkxsN5LzxwLx9fIpr4GqLguxBGmKPAGOcEqN16ad8GEF2sBA7mqtjXMKjO5uu8fC6Nriqis3CGi+6lgTcSvwDomFkXT+yctUU8EdbkBPbo2qnbHji5qt/CslirMio= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=e5wi/gJo; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="e5wi/gJo" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BAE8FC4CEE3; Fri, 4 Jul 2025 13:42:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1751636579; bh=BRkKjHraMotXhhJEgObX7sQONrROrPsZVSsxqUkY/JA=; h=From:To:Cc:Subject:Date:Reply-to:From; b=e5wi/gJoCj51L1e7C1gIH0+W7qyar4Wf8HyYUm071z4rb2BpJXIJK4sF7f5AHDsNq N6t2OxogVNa9eSCO8IEgETz0+9JtdaIW1kvhMDQkHJ/fvnvhT1M5hZIjzjhR3QNruz XD7PopmNAAOqFdvKfruaHnCoNDE4NF3gSCYB6Glo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-38203: jfs: Fix null-ptr-deref in jfs_ioc_trim Date: Fri, 4 Jul 2025 15:37:32 +0200 Message-ID: <2025070419-CVE-2025-38203-8c33@gregkh> X-Mailer: git-send-email 2.50.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=5928; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=szOGZdD9GozGLJ14pGHu2KQCpzkYyUO5OHUIJhXdIP8=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnpN/mT1wfV5H80mu7Xcnn5rwWzUlkYaiJ+l6gvE+Q55 1bKoCvUEcvCIMjEICumyPJlG8/R/RWHFL0MbU/DzGFlAhnCwMUpABNxj2ZYcK7zOWNJS4n2r7Sn f2yyT91dsiKKn2HByaufmT2ae3rv7TU8XGW+aMbHRcq5AA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: jfs: Fix null-ptr-deref in jfs_ioc_trim [ Syzkaller Report ] Oops: general protection fault, probably for non-canonical address 0xdffffc0000000087: 0000 [#1 KASAN: null-ptr-deref in range [0x0000000000000438-0x000000000000043f] CPU: 2 UID: 0 PID: 10614 Comm: syz-executor.0 Not tainted 6.13.0-rc6-gfbfd64d25c7a-dirty #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.15.0-1 04/01/2014 Sched_ext: serialise (enabled+all), task: runnable_at=-30ms RIP: 0010:jfs_ioc_trim+0x34b/0x8f0 Code: e7 e8 59 a4 87 fe 4d 8b 24 24 4d 8d bc 24 38 04 00 00 48 8d 93 90 82 fe ff 4c 89 ff 31 f6 RSP: 0018:ffffc900055f7cd0 EFLAGS: 00010206 RAX: 0000000000000087 RBX: 00005866a9e67ff8 RCX: 000000000000000a RDX: 0000000000000001 RSI: 0000000000000004 RDI: 0000000000000001 RBP: dffffc0000000000 R08: ffff88807c180003 R09: 1ffff1100f830000 R10: dffffc0000000000 R11: ffffed100f830001 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000438 FS: 00007fe520225640(0000) GS:ffff8880b7e80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005593c91b2c88 CR3: 000000014927c000 CR4: 00000000000006f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ? __die_body+0x61/0xb0 ? die_addr+0xb1/0xe0 ? exc_general_protection+0x333/0x510 ? asm_exc_general_protection+0x26/0x30 ? jfs_ioc_trim+0x34b/0x8f0 jfs_ioctl+0x3c8/0x4f0 ? __pfx_jfs_ioctl+0x10/0x10 ? __pfx_jfs_ioctl+0x10/0x10 __se_sys_ioctl+0x269/0x350 ? __pfx___se_sys_ioctl+0x10/0x10 ? do_syscall_64+0xfb/0x210 do_syscall_64+0xee/0x210 ? syscall_exit_to_user_mode+0x1e0/0x330 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fe51f4903ad Code: c3 e8 a7 2b 00 00 0f 1f 80 00 00 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d RSP: 002b:00007fe5202250c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 RAX: ffffffffffffffda RBX: 00007fe51f5cbf80 RCX: 00007fe51f4903ad RDX: 0000000020000680 RSI: 00000000c0185879 RDI: 0000000000000005 RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007fe520225640 R13: 000000000000000e R14: 00007fe51f44fca0 R15: 00007fe52021d000 Modules linked in: ---[ end trace 0000000000000000 ]--- RIP: 0010:jfs_ioc_trim+0x34b/0x8f0 Code: e7 e8 59 a4 87 fe 4d 8b 24 24 4d 8d bc 24 38 04 00 00 48 8d 93 90 82 fe ff 4c 89 ff 31 f6 RSP: 0018:ffffc900055f7cd0 EFLAGS: 00010206 RAX: 0000000000000087 RBX: 00005866a9e67ff8 RCX: 000000000000000a RDX: 0000000000000001 RSI: 0000000000000004 RDI: 0000000000000001 RBP: dffffc0000000000 R08: ffff88807c180003 R09: 1ffff1100f830000 R10: dffffc0000000000 R11: ffffed100f830001 R12: 0000000000000000 R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000438 FS: 00007fe520225640(0000) GS:ffff8880b7e80000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00005593c91b2c88 CR3: 000000014927c000 CR4: 00000000000006f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Kernel panic - not syncing: Fatal exception [ Analysis ] We believe that we have found a concurrency bug in the `fs/jfs` module that results in a null pointer dereference. There is a closely related issue which has been fixed: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d6c1b3599b2feb5c7291f5ac3a36e5fa7cedb234 ... but, unfortunately, the accepted patch appears to still be susceptible to a null pointer dereference under some interleavings. To trigger the bug, we think that `JFS_SBI(ipbmap->i_sb)->bmap` is set to NULL in `dbFreeBits` and then dereferenced in `jfs_ioc_trim`. This bug manifests quite rarely under normal circumstances, but is triggereable from a syz-program. The Linux kernel CVE team has assigned CVE-2025-38203 to this issue. Affected and fixed versions =========================== Fixed in 5.4.295 with commit 0d50231d473f89024158dc62624930de45d13718 Fixed in 5.10.239 with commit a9d41c925069c950e18160e12a7e10e0f58c56fb Fixed in 5.15.186 with commit 4a8cb9908b51500a76f5156423bd295df53bff89 Fixed in 6.15.4 with commit 9806ae34d7d661c372247cd36f83bfa0523d60ed Fixed in 6.16-rc1 with commit a4685408ff6c3e2af366ad9a7274f45ff3f394ee Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2025-38203 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: fs/jfs/jfs_discard.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/0d50231d473f89024158dc62624930de45d13718 https://git.kernel.org/stable/c/a9d41c925069c950e18160e12a7e10e0f58c56fb https://git.kernel.org/stable/c/4a8cb9908b51500a76f5156423bd295df53bff89 https://git.kernel.org/stable/c/9806ae34d7d661c372247cd36f83bfa0523d60ed https://git.kernel.org/stable/c/a4685408ff6c3e2af366ad9a7274f45ff3f394ee