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 AAD5E168DC for ; Sun, 19 May 2024 08:36:35 +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=1716107795; cv=none; b=L8pMTpAuqLbcb55MPPVfbI3pwT6pBfEHWUUllyHMuhmoTJJALHLjEy61+mUQMOHo04GCysy6jKarqtSF8bYgnFXehQp5JXg25XpPVspphXghzXt/aNibNR97ToasStFJii/HnS8e1LXhEPOJzGLxYnwfwtFLP23pWxmSS3HpD2g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716107795; c=relaxed/simple; bh=q2D7I67sacHqTR96fXEdVcog2wdsOHpXn0lefftplqk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=P1Mr9ojRW+h4lcouZmqKB1Ey1cTArYaEbpogJYDCHGSmE6n1QFCqbDTONQIzdx8AVs2y1hQowAPd05QdqF+De1c+d2o98mGbVzCBMR1MPBYlJbL2uLrkMpGDeQAhdq24noiY6uaICwjt3/zrpQkC+AKB7fUmoCze5N6tvrgWza8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dGD7NCvS; 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="dGD7NCvS" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D975EC32781; Sun, 19 May 2024 08:36:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1716107795; bh=q2D7I67sacHqTR96fXEdVcog2wdsOHpXn0lefftplqk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=dGD7NCvSG8ijErSi400bllcxqc/FPkTWzz78vasI4LmO7EWiNVvhOcZ4+FtX4CbiC r81rNmuszuMe4ht1DxkdO4unP72HcbzIpZC4ZeUbkTpCUuDbBQ6cU7B3kgFGCkxA2l yHJ4ceKJYQ8TMjZrYzatqZwy611whOy2c9zQdiNk= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-35894: mptcp: prevent BPF accessing lowat from a subflow socket. Date: Sun, 19 May 2024 10:35:08 +0200 Message-ID: <2024051949-CVE-2024-35894-fd19@gregkh> X-Mailer: git-send-email 2.45.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=2780; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=q2D7I67sacHqTR96fXEdVcog2wdsOHpXn0lefftplqk=; b=owGbwMvMwCRo6H6F97bub03G02pJDGmeO1e9SGbMuHtb6O4E2csf1mhKG/hv2XTrWlzq348VR QrOkiU3O2JZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAiTfMZ5mdOOOyVzGyf++Ck DM+Lk6tVd6QdVGVYsDRo56Lmpk2emt9bn7j3JW+Iv3UgAAA= 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: mptcp: prevent BPF accessing lowat from a subflow socket. Alexei reported the following splat: WARNING: CPU: 32 PID: 3276 at net/mptcp/subflow.c:1430 subflow_data_ready+0x147/0x1c0 Modules linked in: dummy bpf_testmod(O) [last unloaded: bpf_test_no_cfi(O)] CPU: 32 PID: 3276 Comm: test_progs Tainted: GO 6.8.0-12873-g2c43c33bfd23 Call Trace: mptcp_set_rcvlowat+0x79/0x1d0 sk_setsockopt+0x6c0/0x1540 __bpf_setsockopt+0x6f/0x90 bpf_sock_ops_setsockopt+0x3c/0x90 bpf_prog_509ce5db2c7f9981_bpf_test_sockopt_int+0xb4/0x11b bpf_prog_dce07e362d941d2b_bpf_test_socket_sockopt+0x12b/0x132 bpf_prog_348c9b5faaf10092_skops_sockopt+0x954/0xe86 __cgroup_bpf_run_filter_sock_ops+0xbc/0x250 tcp_connect+0x879/0x1160 tcp_v6_connect+0x50c/0x870 mptcp_connect+0x129/0x280 __inet_stream_connect+0xce/0x370 inet_stream_connect+0x36/0x50 bpf_trampoline_6442491565+0x49/0xef inet_stream_connect+0x5/0x50 __sys_connect+0x63/0x90 __x64_sys_connect+0x14/0x20 The root cause of the issue is that bpf allows accessing mptcp-level proto_ops from a tcp subflow scope. Fix the issue detecting the problematic call and preventing any action. The Linux kernel CVE team has assigned CVE-2024-35894 to this issue. Affected and fixed versions =========================== Issue introduced in 6.7 with commit 5684ab1a0eff and fixed in 6.8.5 with commit 3ffb1ab69837 Issue introduced in 6.7 with commit 5684ab1a0eff and fixed in 6.9 with commit fcf4692fa39e 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-35894 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: net/mptcp/sockopt.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/3ffb1ab698376f09cc33101c07c1be229389fe29 https://git.kernel.org/stable/c/fcf4692fa39e86a590c14a4af2de704e1d20a3b5