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 DC3C21F667C for ; Fri, 27 Dec 2024 15:07:55 +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=1735312075; cv=none; b=uSurq0vwkFsLSoRiYOxicJiLkULwP3QaV49lCP1Ro6tTnHfx7crDhmaSjfLwiHLNr+NTw+8XmW9BArn+j84T42zO8R8Ke334Ld5RVSZSkMRetelhCxQrlKFZBNNbSSWvh2m0oo3yNgugxy1VYchWLhAqyuqF+GAC0UbaV06H+qQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735312075; c=relaxed/simple; bh=ps9pJ/h0kJMYaG0GNRj/m5nHMld+uig1RBVdMq9HJgk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=iX5a0DftXfKTwd1RLXo8xvzcO4or5SWdBF0rjrOyhw20K1wbI3L5UFXxbqxCTG1Gk+fFSsDMqHeY3RtPF8vS0iLf7bzQ6lb1X8XIoMcBPo24ik7SfQYIvhb404CqV+/wix6vhtT66+442d9q2q0F79E3yfrcrEzU7udwgHvasa8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=g6kR5ABq; 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="g6kR5ABq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E2AFC4CED3; Fri, 27 Dec 2024 15:07:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1735312075; bh=ps9pJ/h0kJMYaG0GNRj/m5nHMld+uig1RBVdMq9HJgk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=g6kR5ABqwgJ6aBdmLKTXk256ip+CqPz8WSo2ay6ZcjeI6oOnqzCTZJ289tFyJS/zC bECVlTZ15K0j2ur43EdLA/BA/9LMcQaj+f10E6uhPyq9GsWusRp4Tg4lGNYRZCgGUd Q4Tfun4GlT2DlNCJzJFhhmpV6XvureXOAprsP1oY= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-56675: bpf: Fix UAF via mismatching bpf_prog/attachment RCU flavors Date: Fri, 27 Dec 2024 16:07:12 +0100 Message-ID: <2024122756-CVE-2024-56675-e996@gregkh> X-Mailer: git-send-email 2.47.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=2709; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ps9pJ/h0kJMYaG0GNRj/m5nHMld+uig1RBVdMq9HJgk=; b=owGbwMvMwCRo6H6F97bub03G02pJDOl5hyYU7Nz16cfGB5OvHNo285oq4/Inux5f4L3w7ZiY1 40uQ4meio5YFgZBJgZZMUWWL9t4ju6vOKToZWh7GmYOKxPIEAYuTgGYiEIqw4KNZeHScU8UNhw+ tCr9JF+T+RvfnWYMC064CQRk8PMznOrU8LwtduG5n3ZyDwA= 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: bpf: Fix UAF via mismatching bpf_prog/attachment RCU flavors Uprobes always use bpf_prog_run_array_uprobe() under tasks-trace-RCU protection. But it is possible to attach a non-sleepable BPF program to a uprobe, and non-sleepable BPF programs are freed via normal RCU (see __bpf_prog_put_noref()). This leads to UAF of the bpf_prog because a normal RCU grace period does not imply a tasks-trace-RCU grace period. Fix it by explicitly waiting for a tasks-trace-RCU grace period after removing the attachment of a bpf_prog to a perf_event. The Linux kernel CVE team has assigned CVE-2024-56675 to this issue. Affected and fixed versions =========================== Issue introduced in 6.0 with commit 8c7dcb84e3b744b2b70baa7a44a9b1881c33a9c9 and fixed in 6.1.121 with commit 9245459a992d22fe0e92e988f49db1fec82c184a Issue introduced in 6.0 with commit 8c7dcb84e3b744b2b70baa7a44a9b1881c33a9c9 and fixed in 6.6.67 with commit f9f85df30118f3f4112761e6682fc60ebcce23e5 Issue introduced in 6.0 with commit 8c7dcb84e3b744b2b70baa7a44a9b1881c33a9c9 and fixed in 6.12.6 with commit 9b53d2c2a38a1effc341d99be3f99fa7ef17047d Issue introduced in 6.0 with commit 8c7dcb84e3b744b2b70baa7a44a9b1881c33a9c9 and fixed in 6.13-rc3 with commit ef1b808e3b7c98612feceedf985c2fbbeb28f956 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-56675 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/bpf_trace.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/9245459a992d22fe0e92e988f49db1fec82c184a https://git.kernel.org/stable/c/f9f85df30118f3f4112761e6682fc60ebcce23e5 https://git.kernel.org/stable/c/9b53d2c2a38a1effc341d99be3f99fa7ef17047d https://git.kernel.org/stable/c/ef1b808e3b7c98612feceedf985c2fbbeb28f956