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 9E5FD1DC99E for ; Sun, 19 Jan 2025 11:53:29 +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=1737287609; cv=none; b=FmIqin675bSQ31KifC6QZsNx2T6ehQRvNjnwGJ1o60JJiMY60vRHMcQRMR4l74BhgdcdDZW7Lozg6EP4CkXSNfUl1cpGXvWHBEspPu6gthAOwAQi5Mb8QNUiB6QVJiBrNLaZTIVVWPBRKn5GnqZr3RpLTHrsBLxiXzyoIfzg1Xw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737287609; c=relaxed/simple; bh=E/XgqZ+1M/7N+W9fgvXcgKMjxJW+7Wpl/0VuCqmCEKw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=a8x4qJCxGQJiUTU8aDsOHk042zq5RWtG1qbliWe5pc0wEp8d9sDyadSCvzvDjhmmRNOX0byqjMf2O3FCrQrbX7gA4CJiVy8P0yV6iEoawBxiWSJ3O5eb/DtoQP/U3tUVKQJmJFXF97nsbOQv710UGyWu4x7zigvpR9c+e/B3dR0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=b7XWzl+N; 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="b7XWzl+N" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 23F26C4CED6; Sun, 19 Jan 2025 11:53:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1737287609; bh=E/XgqZ+1M/7N+W9fgvXcgKMjxJW+7Wpl/0VuCqmCEKw=; h=From:To:Cc:Subject:Date:Reply-to:From; b=b7XWzl+NWhd5tYMF56GJZ5h/Xw+wD0330mux1bN2kgOUhbkl29QCm6Dh1fQ6W/E84 2/CGyz+IFYK7sTEnTwGYf1FTGkyA6vQ2KBUDD/0rU7iB5D0fTtHAuROCxGATYQPSeO BXMQsZd2IwQOMG9mqVhmFhO+CutmpvN+AM7z9SSk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-57923: btrfs: zlib: fix avail_in bytes for s390 zlib HW compression path Date: Sun, 19 Jan 2025 12:52:54 +0100 Message-ID: <2025011943-CVE-2024-57923-3c99@gregkh> X-Mailer: git-send-email 2.48.1 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=4266; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=E/XgqZ+1M/7N+W9fgvXcgKMjxJW+7Wpl/0VuCqmCEKw=; b=owGbwMvMwCRo6H6F97bub03G02pJDOk9z7trQ+zn9rDv71x/sbhDkEnYtFdqwdQAzve6uoGZi 79l/Y7tiGVhEGRikBVTZPmyjefo/opDil6Gtqdh5rAygQxh4OIUgIn0ljDMj/mwd1ZlU+ePqUV3 Vb25BBf8rVduZZifb7T1lErGRQtP3QzWvBMbNe9Fd1sDAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: btrfs: zlib: fix avail_in bytes for s390 zlib HW compression path Since the input data length passed to zlib_compress_folios() can be arbitrary, always setting strm.avail_in to a multiple of PAGE_SIZE may cause read-in bytes to exceed the input range. Currently this triggers an assert in btrfs_compress_folios() on the debug kernel (see below). Fix strm.avail_in calculation for S390 hardware acceleration path. assertion failed: *total_in <= orig_len, in fs/btrfs/compression.c:1041 ------------[ cut here ]------------ kernel BUG at fs/btrfs/compression.c:1041! monitor event: 0040 ilc:2 [#1] PREEMPT SMP CPU: 16 UID: 0 PID: 325 Comm: kworker/u273:3 Not tainted 6.13.0-20241204.rc1.git6.fae3b21430ca.300.fc41.s390x+debug #1 Hardware name: IBM 3931 A01 703 (z/VM 7.4.0) Workqueue: btrfs-delalloc btrfs_work_helper Krnl PSW : 0704d00180000000 0000021761df6538 (btrfs_compress_folios+0x198/0x1a0) R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:1 PM:0 RI:0 EA:3 Krnl GPRS: 0000000080000000 0000000000000001 0000000000000047 0000000000000000 0000000000000006 ffffff01757bb000 000001976232fcc0 000000000000130c 000001976232fcd0 000001976232fcc8 00000118ff4a0e30 0000000000000001 00000111821ab400 0000011100000000 0000021761df6534 000001976232fb58 Krnl Code: 0000021761df6528: c020006f5ef4 larl %r2,0000021762be2310 0000021761df652e: c0e5ffbd09d5 brasl %r14,00000217615978d8 #0000021761df6534: af000000 mc 0,0 >0000021761df6538: 0707 bcr 0,%r7 0000021761df653a: 0707 bcr 0,%r7 0000021761df653c: 0707 bcr 0,%r7 0000021761df653e: 0707 bcr 0,%r7 0000021761df6540: c004004bb7ec brcl 0,000002176276d518 Call Trace: [<0000021761df6538>] btrfs_compress_folios+0x198/0x1a0 ([<0000021761df6534>] btrfs_compress_folios+0x194/0x1a0) [<0000021761d97788>] compress_file_range+0x3b8/0x6d0 [<0000021761dcee7c>] btrfs_work_helper+0x10c/0x160 [<0000021761645760>] process_one_work+0x2b0/0x5d0 [<000002176164637e>] worker_thread+0x20e/0x3e0 [<000002176165221a>] kthread+0x15a/0x170 [<00000217615b859c>] __ret_from_fork+0x3c/0x60 [<00000217626e72d2>] ret_from_fork+0xa/0x38 INFO: lockdep is turned off. Last Breaking-Event-Address: [<0000021761597924>] _printk+0x4c/0x58 Kernel panic - not syncing: Fatal exception: panic_on_oops The Linux kernel CVE team has assigned CVE-2024-57923 to this issue. Affected and fixed versions =========================== Issue introduced in 6.12 with commit fd1e75d0105d2289e24b6d63cee49e6f7952c8bf and fixed in 6.12.10 with commit 25adbb08aeadcff883ab801df99fd20fefbb6ca4 Issue introduced in 6.12 with commit fd1e75d0105d2289e24b6d63cee49e6f7952c8bf and fixed in 6.13-rc7 with commit 0ee4736c003daded513de0ff112d4a1e9c85bbab 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-2024-57923 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/btrfs/zlib.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/25adbb08aeadcff883ab801df99fd20fefbb6ca4 https://git.kernel.org/stable/c/0ee4736c003daded513de0ff112d4a1e9c85bbab