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 5E5542E5437 for ; Wed, 1 Oct 2025 11:54:28 +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=1759319668; cv=none; b=Bi3oSkKSJtm/ofackOjCJk6fJDnkkdFqqZYtd3JJBNbXDsSMhvfxDtxq49xiIJtxQ2WR5laukK4v1ZoyeTZFqSgx/VKdJTMEnRY/PRv6jSbOlEh+sqf8VZ14A43wRFc5uRouxyYx/BZ1jKXe9ge4za9qTKaa6/nTePVJn3FRpPs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759319668; c=relaxed/simple; bh=iBjAUZyXD+Qfb6VOnJJVQ74Qo4UNztLJs+zvA9OAmdI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=BaoZKFx5/Is2rM2Ucl4XHlqm3N1GaEwydxH4n+nid168dFIXxAQxZdWeRoch9xCH55zA2Fc5zjWwwSlBE3ErQN8il19MAagA04Hv5lOo8lldY0yQSilgrO9xKcw/nhvIHepVjONxS9OJpT8GOa64qyhc6E4Ths5OqRHVdAM2iMc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=EZYuJdib; 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="EZYuJdib" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D4033C4CEF4; Wed, 1 Oct 2025 11:54:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759319668; bh=iBjAUZyXD+Qfb6VOnJJVQ74Qo4UNztLJs+zvA9OAmdI=; h=From:To:Cc:Subject:Date:Reply-to:From; b=EZYuJdibJGSQ2VLI6WB+MH5jeoa7tah568XKVITXnJKCR3oI0tYZ422tvaPkxc5Rr 1ng4rwcz3YtQEtWhH1kd47/WP9eorbQgeGP7r6GnEP26JKWtiGf30ru22kcZHJW1fY aUk1ggdjNk3vynwWOdX8lVeAFrb/1u2VbxqpEu2s= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53485: fs: jfs: Fix UBSAN: array-index-out-of-bounds in dbAllocDmapLev Date: Wed, 1 Oct 2025 13:42:55 +0200 Message-ID: <2025100114-CVE-2023-53485-672c@gregkh> X-Mailer: git-send-email 2.51.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=5004; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=0cxn6Da5BKc113FItwoxgYPQg5h89MZQFjggR45MfsU=; b=owGbwMvMwCRo6H6F97bub03G02pJDBl3hadtcjvqLf/rSc5kzX1T/4tdv/NowYyzj44v9b6lt +TVxvMFVR2xLAyCTAyyYoosX7bxHN1fcUjRy9D2NMwcViaQIQxcnAIwkXuCDPM0u9ZXxFp6xBqq aNaI687hKba/Ycswh/fT4Qd+Fx7seHLubYVeppf9DseZbwE= 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: fs: jfs: Fix UBSAN: array-index-out-of-bounds in dbAllocDmapLev Syzkaller reported the following issue: UBSAN: array-index-out-of-bounds in fs/jfs/jfs_dmap.c:1965:6 index -84 is out of range for type 's8[341]' (aka 'signed char[341]') CPU: 1 PID: 4995 Comm: syz-executor146 Not tainted 6.4.0-rc6-syzkaller-00037-gb6dad5178cea #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e7/0x2d0 lib/dump_stack.c:106 ubsan_epilogue lib/ubsan.c:217 [inline] __ubsan_handle_out_of_bounds+0x11c/0x150 lib/ubsan.c:348 dbAllocDmapLev+0x3e5/0x430 fs/jfs/jfs_dmap.c:1965 dbAllocCtl+0x113/0x920 fs/jfs/jfs_dmap.c:1809 dbAllocAG+0x28f/0x10b0 fs/jfs/jfs_dmap.c:1350 dbAlloc+0x658/0xca0 fs/jfs/jfs_dmap.c:874 dtSplitUp fs/jfs/jfs_dtree.c:974 [inline] dtInsert+0xda7/0x6b00 fs/jfs/jfs_dtree.c:863 jfs_create+0x7b6/0xbb0 fs/jfs/namei.c:137 lookup_open fs/namei.c:3492 [inline] open_last_lookups fs/namei.c:3560 [inline] path_openat+0x13df/0x3170 fs/namei.c:3788 do_filp_open+0x234/0x490 fs/namei.c:3818 do_sys_openat2+0x13f/0x500 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_openat fs/open.c:1388 [inline] __se_sys_openat fs/open.c:1383 [inline] __x64_sys_openat+0x247/0x290 fs/open.c:1383 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f1f4e33f7e9 Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 51 14 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffc21129578 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f1f4e33f7e9 RDX: 000000000000275a RSI: 0000000020000040 RDI: 00000000ffffff9c RBP: 00007f1f4e2ff080 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f1f4e2ff110 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 The bug occurs when the dbAllocDmapLev()function attempts to access dp->tree.stree[leafidx + LEAFIND] while the leafidx value is negative. To rectify this, the patch introduces a safeguard within the dbAllocDmapLev() function. A check has been added to verify if leafidx is negative. If it is, the function immediately returns an I/O error, preventing any further execution that could potentially cause harm. Tested via syzbot. The Linux kernel CVE team has assigned CVE-2023-53485 to this issue. Affected and fixed versions =========================== Fixed in 4.14.324 with commit 0d9e678a82915633b99603f744e7735d1a673d72 Fixed in 4.19.293 with commit 53b0a362aca2583729e8ca2936ca657ff3247d88 Fixed in 5.4.255 with commit 6e7d9d76e5654bcdd3cdb7c9441a8113428ecebb Fixed in 5.10.192 with commit 911b48eec45152822bccf45cd3563b48256b1520 Fixed in 5.15.123 with commit 39f6292d75959e8accac0b3e24090094ba0824e9 Fixed in 6.1.42 with commit bdf07ab1595b613b03f32dbb5cb379edfa1a7334 Fixed in 6.4.7 with commit f2af019091f904ca08b3572ab0111238ad6d17b3 Fixed in 6.5 with commit 4e302336d5ca1767a06beee7596a72d3bdc8d983 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-2023-53485 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_dmap.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/0d9e678a82915633b99603f744e7735d1a673d72 https://git.kernel.org/stable/c/53b0a362aca2583729e8ca2936ca657ff3247d88 https://git.kernel.org/stable/c/6e7d9d76e5654bcdd3cdb7c9441a8113428ecebb https://git.kernel.org/stable/c/911b48eec45152822bccf45cd3563b48256b1520 https://git.kernel.org/stable/c/39f6292d75959e8accac0b3e24090094ba0824e9 https://git.kernel.org/stable/c/bdf07ab1595b613b03f32dbb5cb379edfa1a7334 https://git.kernel.org/stable/c/f2af019091f904ca08b3572ab0111238ad6d17b3 https://git.kernel.org/stable/c/4e302336d5ca1767a06beee7596a72d3bdc8d983