From mboxrd@z Thu Jan 1 00:00:00 1970 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 91348144D11 for ; Fri, 5 Jul 2024 06:55:51 +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=1720162551; cv=none; b=qjfRhsSGV5OsMsLwGE/104MD0FLWI32fxx+h6yQZ560dW3/1YS7P1Wpez7gzdm1vWjoHAyMxbeV9Gq4hWlHOTMsdal4ugHOhao7Fq9OwDedqnLXWoCpNRmj5CUy9UQNCMImipcJPaHU6WRPAOK+4/j2qaoSKdElk68XutBbiW2E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1720162551; c=relaxed/simple; bh=QE2Y2tNMM22eltHV0Tt7SaC2gOM8xh3O5GYPuXUj/68=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=FipxeChSjWk+DT974OcmlKJaF8xEuMrgC5N9+mbp6NWGjqf8BIDRcyEKJ027RvVIF3HpugaMmOS7H9/pL/C6rEFdfAy/Q598ulgDRmidepaapqRNDoKZrHanU9wGRImdFtodiDybedqK5vcXGdJMOhf6RYVLfPjqa9ZyBoeYWag= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=YPwsk3ZE; 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="YPwsk3ZE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 173F6C4AF0A; Fri, 5 Jul 2024 06:55:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1720162551; bh=QE2Y2tNMM22eltHV0Tt7SaC2gOM8xh3O5GYPuXUj/68=; h=From:To:Cc:Subject:Date:Reply-to:From; b=YPwsk3ZE+xYPXCHzw5ddbralQn5Pz7dRcSQ8849U1tFQQd1rTF7uf8FaiuQETcNop UabjaQ4NVHwmVvhMiffMy9d2M7fp1wdHo8dBDEX3xmOKd+eCXGUpL3DLgxkKTwBlkj H4/kGa/ucUMJtBdKDKHgvWZYbVLiy8Gz7RyhlbUg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-39482: bcache: fix variable length array abuse in btree_iter Date: Fri, 5 Jul 2024 08:55:26 +0200 Message-ID: <2024070520-CVE-2024-39482-8ed3@gregkh> X-Mailer: git-send-email 2.45.2 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=2480; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=QE2Y2tNMM22eltHV0Tt7SaC2gOM8xh3O5GYPuXUj/68=; b=owGbwMvMwCRo6H6F97bub03G02pJDGntM26UxftzNdRe59h+TsHm989UtrvCj06d2xJ5IPb9R L25ypa3OmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiCVEM88ueTTwc9/bMk+JJ HzYrsN77WsYvqsaw4IZ/6v97x07rL5qRnLh0sXdLqeidFgA= 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: bcache: fix variable length array abuse in btree_iter btree_iter is used in two ways: either allocated on the stack with a fixed size MAX_BSETS, or from a mempool with a dynamic size based on the specific cache set. Previously, the struct had a fixed-length array of size MAX_BSETS which was indexed out-of-bounds for the dynamically-sized iterators, which causes UBSAN to complain. This patch uses the same approach as in bcachefs's sort_iter and splits the iterator into a btree_iter with a flexible array member and a btree_iter_stack which embeds a btree_iter as well as a fixed-length data array. The Linux kernel CVE team has assigned CVE-2024-39482 to this issue. Affected and fixed versions =========================== Fixed in 6.1.94 with commit 934e1e433185 Fixed in 6.6.34 with commit 6479b9f41583 Fixed in 6.9.5 with commit 0c31344e22dd Fixed in 6.10-rc1 with commit 3a861560ccb3 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-39482 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: drivers/md/bcache/bset.c drivers/md/bcache/bset.h drivers/md/bcache/btree.c drivers/md/bcache/super.c drivers/md/bcache/sysfs.c drivers/md/bcache/writeback.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/934e1e4331859183a861f396d7dfaf33cb5afb02 https://git.kernel.org/stable/c/6479b9f41583b013041943c4602e1ad61cec8148 https://git.kernel.org/stable/c/0c31344e22dd8d6b1394c6e4c41d639015bdc671 https://git.kernel.org/stable/c/3a861560ccb35f2a4f0a4b8207fa7c2a35fc7f31