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 E39261F03D5 for ; Tue, 21 Jan 2025 12:02:07 +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=1737460928; cv=none; b=CaHXHhaItSNxdssMG7ZyxpHLOakm3d0TgDqYCQLsXJN1xHVkEWaE3c8wVE7UksHkcnnXmlHfppvnaMQs16mp37Z9oT4OknLGniHSOqMQEjNFZxW4VXTSCtBo/ltSwdVj9yBsQV/BSAdUpBaAE9+DFVddJsyRuqz+yqZieYaB2rM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737460928; c=relaxed/simple; bh=zp3PJnYbb6jSc0BDrs5mW/HzdO59XAiiYF8m2rBAUVw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=h3bQY3KV5QYq02sfuTOtl6pwVv6U6BpeNT20k9DczxQ8SsqGjR+NP41t89cg/M56jU/xtAT3VMmayGdzavF1czpGhO6VMGduosGuTkYZKtyKbF/v8CUUAvDzbC0E8PLNVzXN3AUxP5YG0eznjGmWp5zn+ZXtJyRcg4WPGUfbztU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=SasnIEbJ; 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="SasnIEbJ" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 639CBC4CEDF; Tue, 21 Jan 2025 12:02:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1737460927; bh=zp3PJnYbb6jSc0BDrs5mW/HzdO59XAiiYF8m2rBAUVw=; h=From:To:Cc:Subject:Date:Reply-to:From; b=SasnIEbJ6zlOQIlkPl7S2Izs8PQj4jVvV6+3AkZBpljvphhoxPBHYP2L0X0kh5ify EpLPJwswXy9s2/1+m++4NF2lczcFR8NpYakVjtzKN0UiBGg3ANz9uzr7HiqK3rBjv+ 6b+WFbNl/MsnS3/Hs+x4VHk6vQ7+FWwXmJe9Jrqg= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-57934: fgraph: Add READ_ONCE() when accessing fgraph_array[] Date: Tue, 21 Jan 2025 13:01:48 +0100 Message-ID: <2025012148-CVE-2024-57934-6cd8@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=2461; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=zp3PJnYbb6jSc0BDrs5mW/HzdO59XAiiYF8m2rBAUVw=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn9PWuYMmKmGqrlFk95ZWyYFpw/6QBPr2dKJN+qmNt5e Skf1NU7YlkYBJkYZMUUWb5s4zm6v+KQopeh7WmYOaxMIEMYuDgFYCJqegyz2Q1+dH4Xyj7olpbd cPlAZm9+8q4ohvnZJSUfbHQUv3LKMST0Hv69ROCTTxIA 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: fgraph: Add READ_ONCE() when accessing fgraph_array[] In __ftrace_return_to_handler(), a loop iterates over the fgraph_array[] elements, which are fgraph_ops. The loop checks if an element is a fgraph_stub to prevent using a fgraph_stub afterward. However, if the compiler reloads fgraph_array[] after this check, it might race with an update to fgraph_array[] that introduces a fgraph_stub. This could result in the stub being processed, but the stub contains a null "func_hash" field, leading to a NULL pointer dereference. To ensure that the gops compared against the fgraph_stub matches the gops processed later, add a READ_ONCE(). A similar patch appears in commit 63a8dfb ("function_graph: Add READ_ONCE() when accessing fgraph_array[]"). The Linux kernel CVE team has assigned CVE-2024-57934 to this issue. Affected and fixed versions =========================== Issue introduced in 6.11 with commit 37238abe3cb47b8daaa8706c9949f67b2a705cf1 and fixed in 6.12.9 with commit b68b2a3fbacc7be720ef589d489bcacdd05c6d38 Issue introduced in 6.11 with commit 37238abe3cb47b8daaa8706c9949f67b2a705cf1 and fixed in 6.13 with commit d65474033740ded0a4fe9a097fce72328655b41d 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-57934 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: kernel/trace/fgraph.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/b68b2a3fbacc7be720ef589d489bcacdd05c6d38 https://git.kernel.org/stable/c/d65474033740ded0a4fe9a097fce72328655b41d