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 3DD322E7652 for ; Wed, 1 Oct 2025 11:58:01 +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=1759319881; cv=none; b=IhTATSpISc2hiAeITeF+lEvNNv5MUySK4smTPNsOqVd6UrHh7H3D2PUYOXH5ILKTd+ahzN/M56ZxrX9Py4OJ90tyIrPKRMLu8eK2+2GTKYVrooJFaq0UF14zGpFuMEgjiOlWBg20trlkg93NR+Vdkr/E4UqmPC+U/Vt2lX6vEVk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759319881; c=relaxed/simple; bh=+D3BMU9rxWyQLDkAp3XYV0BPCgo+TX9qRCnnFqB7e0g=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=atakiANAB/ScO8f8wj61WVAQ36rwj1whYyLMyHZXD5lX03VDRs88zh0BuE62M+IWD2zvMb+marzJrv4jsd0L5maOWCnZ6SH6M/zBBXPc28XLsgLL/X+HHBUQ0ZrrLKCHKxjT/d+kWY7OMUvshs7ABGOwyhE1eqPPqmy1eFQ4jAY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=pwBMzJlM; 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="pwBMzJlM" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A5729C4CEF4; Wed, 1 Oct 2025 11:58:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759319881; bh=+D3BMU9rxWyQLDkAp3XYV0BPCgo+TX9qRCnnFqB7e0g=; h=From:To:Cc:Subject:Date:Reply-to:From; b=pwBMzJlMOsfqhTW4F8RmsGuQhfYw/ZVaoU/30FpAlP63Zw6HHcBj/UkakE7gTRzbg 8IqTLAS1XUqMIc2HnMGESwbUBNe7vEFRBmRJRVqQczbEHtDH2hdh+s+7WQBcr2j3lI tOi6NnOK4pmEuF77OMzrEZl+SidOZ4BvP7rt5kMw= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2023-53490: mptcp: fix disconnect vs accept race Date: Wed, 1 Oct 2025 13:45:42 +0200 Message-ID: <2025100123-CVE-2023-53490-c90f@gregkh> X-Mailer: git-send-email 2.51.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=4679; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=q1evsiK7MwQOvkASIeh7QhR4BlE4Vr0YmFeBT7pld3U=; b=owGbwMvMwCRo6H6F97bub03G02pJDBl3RYLP3n73TOrRg3vaFuGx6WbVum2CX379vKe28nWx0 Ic92i4nOmJZGASZGGTFFFm+bOM5ur/ikKKXoe1pmDmsTCBDGLg4BWAinP0Mc6V947iaGcriXske OGb+7d2qKCnvCwxzBQ/sus9o9+erx86tW8RYar9uMpLkBgA= 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: fix disconnect vs accept race Despite commit 0ad529d9fd2b ("mptcp: fix possible divide by zero in recvmsg()"), the mptcp protocol is still prone to a race between disconnect() (or shutdown) and accept. The root cause is that the mentioned commit checks the msk-level flag, but mptcp_stream_accept() does acquire the msk-level lock, as it can rely directly on the first subflow lock. As reported by Christoph than can lead to a race where an msk socket is accepted after that mptcp_subflow_queue_clean() releases the listener socket lock and just before it takes destructive actions leading to the following splat: BUG: kernel NULL pointer dereference, address: 0000000000000012 PGD 5a4ca067 P4D 5a4ca067 PUD 37d4c067 PMD 0 Oops: 0000 [#1] PREEMPT SMP CPU: 2 PID: 10955 Comm: syz-executor.5 Not tainted 6.5.0-rc1-gdc7b257ee5dd #37 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-2.el7 04/01/2014 RIP: 0010:mptcp_stream_accept+0x1ee/0x2f0 include/net/inet_sock.h:330 Code: 0a 09 00 48 8b 1b 4c 39 e3 74 07 e8 bc 7c 7f fe eb a1 e8 b5 7c 7f fe 4c 8b 6c 24 08 eb 05 e8 a9 7c 7f fe 49 8b 85 d8 09 00 00 <0f> b6 40 12 88 44 24 07 0f b6 6c 24 07 bf 07 00 00 00 89 ee e8 89 RSP: 0018:ffffc90000d07dc0 EFLAGS: 00010293 RAX: 0000000000000000 RBX: ffff888037e8d020 RCX: ffff88803b093300 RDX: 0000000000000000 RSI: ffffffff833822c5 RDI: ffffffff8333896a RBP: 0000607f82031520 R08: ffff88803b093300 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000003e83 R12: ffff888037e8d020 R13: ffff888037e8c680 R14: ffff888009af7900 R15: ffff888009af6880 FS: 00007fc26d708640(0000) GS:ffff88807dd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000012 CR3: 0000000066bc5001 CR4: 0000000000370ee0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: do_accept+0x1ae/0x260 net/socket.c:1872 __sys_accept4+0x9b/0x110 net/socket.c:1913 __do_sys_accept4 net/socket.c:1954 [inline] __se_sys_accept4 net/socket.c:1951 [inline] __x64_sys_accept4+0x20/0x30 net/socket.c:1951 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x47/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x6e/0xd8 Address the issue by temporary removing the pending request socket from the accept queue, so that racing accept() can't touch them. After depleting the msk - the ssk still exists, as plain TCP sockets, re-insert them into the accept queue, so that later inet_csk_listen_stop() will complete the tcp socket disposal. The Linux kernel CVE team has assigned CVE-2023-53490 to this issue. Affected and fixed versions =========================== Issue introduced in 6.1.27 with commit b45d8f5375eda3ddc89fe529b58bb643917bd87b and fixed in 6.1.46 with commit ded9f5551ce5cafa3c41c794428c27a0d0a00542 Issue introduced in 6.3 with commit 2a6a870e44dd88f1a6a2893c65ef756a9edfb4c7 and fixed in 6.4.11 with commit b2b4c84eb7149f34c0f25f17042d095ba5357d68 Issue introduced in 6.3 with commit 2a6a870e44dd88f1a6a2893c65ef756a9edfb4c7 and fixed in 6.5 with commit 511b90e39250135a7f900f1c3afbce25543018a2 Issue introduced in 6.2.13 with commit 64b66601308dae6105fbde964a339462a29c2a73 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-53490 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.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/ded9f5551ce5cafa3c41c794428c27a0d0a00542 https://git.kernel.org/stable/c/b2b4c84eb7149f34c0f25f17042d095ba5357d68 https://git.kernel.org/stable/c/511b90e39250135a7f900f1c3afbce25543018a2