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 DDC20259CA7 for ; Fri, 2 May 2025 15:58:11 +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=1746201492; cv=none; b=pB9QgIXE3A6foC+UwbKOEi86pzTMUv7ghfd3VMs3urJ6E72MOjMJDzCNyiDtdOD5LT1IHTs2ys99O3Blguba4uwlCiLmQbSvI92EayEUj0CCiBs2uCXPna7Vb05n3Axg/R+GIRlQ31g5SOnuafI+X2OYke91bvui7AMk2kSrdeY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746201492; c=relaxed/simple; bh=dE0nqEEsOJHbgMfTERnLIZqFb7BaNB7zOfN2BNQOHgk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=mqlVMnJokXuPQrncbQ/ZP8jTwiwGgKNvwzrKe8Flq8BpGtxbLds2x6eFXgeObp//yBTG302bp+UBfinRSYuSoOCkNbVx+UzjMZn40HUIZuNfAIpLY6yv5yOLYuV6d3wAwa5r9Nbs66/aANhlqVZH9VfFcLHJZ9McycM5KH7I9Mo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hFGB0KXC; 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="hFGB0KXC" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6F9A2C4CEE4; Fri, 2 May 2025 15:58:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746201491; bh=dE0nqEEsOJHbgMfTERnLIZqFb7BaNB7zOfN2BNQOHgk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=hFGB0KXCw+Yq961aBXn49c37lBC/FJT2YbWPOSnfWm75emlJ97O0Px5ulYrgJoYn3 +wwTbKvS6cvx6m5BleakU5qU0yPAYYNiiPXX0vaBjSMphETipATV/etLyr+yqrHxgW yI8o8kenp4CQdrLfU4zeyRJmEiwEebEP0wIgkdBU= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53072: mptcp: use the workqueue to destroy unaccepted sockets Date: Fri, 2 May 2025 17:55:37 +0200 Message-ID: <2025050213-CVE-2023-53072-4ab2@gregkh> X-Mailer: git-send-email 2.49.0 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=3695; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=a+JZfqqBUTvcQFzDlqUJ0Dki3WgVgssCinnVqQyX1dU=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkirx6xGyVdf73fN/jV1eYLEX+7f+X/03jVffLi4/NM9 0UWXkwP64hlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJvHzJMD/vqfu2gzP7rmWv Dt30eursorachASG+SVFlzRynvs/iPl66Hrx6u+PTi+cvQUA X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: mptcp: use the workqueue to destroy unaccepted sockets Christoph reported a UaF at token lookup time after having refactored the passive socket initialization part: BUG: KASAN: use-after-free in __token_bucket_busy+0x253/0x260 Read of size 4 at addr ffff88810698d5b0 by task syz-executor653/3198 CPU: 1 PID: 3198 Comm: syz-executor653 Not tainted 6.2.0-rc59af4eaa31c1f6c00c8f1e448ed99a45c66340dd5 #6 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 Call Trace: dump_stack_lvl+0x6e/0x91 print_report+0x16a/0x46f kasan_report+0xad/0x130 __token_bucket_busy+0x253/0x260 mptcp_token_new_connect+0x13d/0x490 mptcp_connect+0x4ed/0x860 __inet_stream_connect+0x80e/0xd90 tcp_sendmsg_fastopen+0x3ce/0x710 mptcp_sendmsg+0xff1/0x1a20 inet_sendmsg+0x11d/0x140 __sys_sendto+0x405/0x490 __x64_sys_sendto+0xdc/0x1b0 do_syscall_64+0x3b/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc We need to properly clean-up all the paired MPTCP-level resources and be sure to release the msk last, even when the unaccepted subflow is destroyed by the TCP internals via inet_child_forget(). We can re-use the existing MPTCP_WORK_CLOSE_SUBFLOW infra, explicitly checking that for the critical scenario: the closed subflow is the MPC one, the msk is not accepted and eventually going through full cleanup. With such change, __mptcp_destroy_sock() is always called on msk sockets, even on accepted ones. We don't need anymore to transiently drop one sk reference at msk clone time. Please note this commit depends on the parent one: mptcp: refactor passive socket initialization The Linux kernel CVE team has assigned CVE-2023-53072 to this issue. Affected and fixed versions =========================== Issue introduced in 5.7 with commit 58b09919626bf9067345289212ec030c61eb1034 and fixed in 6.1.22 with commit 2827f099b3fb9a59263c997400e9182f5d423e84 Issue introduced in 5.7 with commit 58b09919626bf9067345289212ec030c61eb1034 and fixed in 6.2.8 with commit 804cf487fb0031f3c74755b78d8663333f0ba636 Issue introduced in 5.7 with commit 58b09919626bf9067345289212ec030c61eb1034 and fixed in 6.3 with commit b6985b9b82954caa53f862d6059d06c0526254f0 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-2023-53072 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/protocol.c net/mptcp/protocol.h net/mptcp/subflow.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/2827f099b3fb9a59263c997400e9182f5d423e84 https://git.kernel.org/stable/c/804cf487fb0031f3c74755b78d8663333f0ba636 https://git.kernel.org/stable/c/b6985b9b82954caa53f862d6059d06c0526254f0