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 A957310A03 for ; Wed, 19 Jun 2024 14:54:58 +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=1718808898; cv=none; b=jzrrbe2cbF1w8DndsW9udJNgD5zhA/n92nu8n48ul1AJwx/A0qTZJxjA+qFIQm1ti23OJZbtWEZu0KkYoccDUoRhAQhLSTYFOQ/zXck8qRkkiCEdIyoTV/No+nrVMmWVkf4fG5QJKob1/khl8L2sCoTC+RyDnqp5Ce4ENlkiIGg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718808898; c=relaxed/simple; bh=GZAXB4iUBUScQ6Sl+utFtBWsLu4ww1m1ZUhgb3nGoH0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=BycXncgAV4Ebt+wkYCUWBm561Zhpho2m7fuockvwq6yHYssA87a6xlGhODGDS7EVkwO2TFfFES8KkPvyJZyo91yrT1Tg5Rm9Ucf1rwldDzms+O+IhZIG4aaCGprX7YsFfe/NB3wkKy/pgwhX4hL1Z7RdxkCKOt/8FkHGmCgj9u8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jZyJbpSI; 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="jZyJbpSI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C60ADC2BBFC; Wed, 19 Jun 2024 14:54:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718808898; bh=GZAXB4iUBUScQ6Sl+utFtBWsLu4ww1m1ZUhgb3nGoH0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=jZyJbpSIt7QoEW5NJsGc1EZV1B2Dq1hA/q+FwwTsTT41BMg6oKn8Xyy9NB64EY/7D QdsiYmlDyPeKPBaOXq/eOrleCuDkQlvbET/t5wUXVPWlW4PoG72ice6lvFqWRn1Ajo oSDGXpqYHEO8JbvMQyXCGpSX2DFghKs1rYD+JTHA= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2021-47590: mptcp: fix deadlock in __mptcp_push_pending() Date: Wed, 19 Jun 2024 16:54:29 +0200 Message-ID: <2024061919-CVE-2021-47590-6db0@gregkh> X-Mailer: git-send-email 2.45.2 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=3200; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=GZAXB4iUBUScQ6Sl+utFtBWsLu4ww1m1ZUhgb3nGoH0=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlFH6XzTq5ZqztRqTH7zifNpuTpp/bWncnw3eY5vyXrs n2t7w+tjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZhIuh7DgvY3Oxb6TmnaIzf3 9rtJ4gdFlyhXyjLMd1zzMfndzzzhTJuH7VMlFoWf7jeZAwA= 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: fix deadlock in __mptcp_push_pending() __mptcp_push_pending() may call mptcp_flush_join_list() with subflow socket lock held. If such call hits mptcp_sockopt_sync_all() then subsequently __mptcp_sockopt_sync() could try to lock the subflow socket for itself, causing a deadlock. sysrq: Show Blocked State task:ss-server state:D stack: 0 pid: 938 ppid: 1 flags:0x00000000 Call Trace: __schedule+0x2d6/0x10c0 ? __mod_memcg_state+0x4d/0x70 ? csum_partial+0xd/0x20 ? _raw_spin_lock_irqsave+0x26/0x50 schedule+0x4e/0xc0 __lock_sock+0x69/0x90 ? do_wait_intr_irq+0xa0/0xa0 __lock_sock_fast+0x35/0x50 mptcp_sockopt_sync_all+0x38/0xc0 __mptcp_push_pending+0x105/0x200 mptcp_sendmsg+0x466/0x490 sock_sendmsg+0x57/0x60 __sys_sendto+0xf0/0x160 ? do_wait_intr_irq+0xa0/0xa0 ? fpregs_restore_userregs+0x12/0xd0 __x64_sys_sendto+0x20/0x30 do_syscall_64+0x38/0x90 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7f9ba546c2d0 RSP: 002b:00007ffdc3b762d8 EFLAGS: 00000246 ORIG_RAX: 000000000000002c RAX: ffffffffffffffda RBX: 00007f9ba56c8060 RCX: 00007f9ba546c2d0 RDX: 000000000000077a RSI: 0000000000e5e180 RDI: 0000000000000234 RBP: 0000000000cc57f0 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f9ba56c8060 R13: 0000000000b6ba60 R14: 0000000000cc7840 R15: 41d8685b1d7901b8 Fix the issue by using __mptcp_flush_join_list() instead of plain mptcp_flush_join_list() inside __mptcp_push_pending(), as suggested by Florian. The sockopt sync will be deferred to the workqueue. The Linux kernel CVE team has assigned CVE-2021-47590 to this issue. Affected and fixed versions =========================== Issue introduced in 5.13 with commit 1b3e7ede1365 and fixed in 5.15.11 with commit 23311b92755f Issue introduced in 5.13 with commit 1b3e7ede1365 and fixed in 5.16 with commit 3d79e3756ca9 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-2021-47590 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 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/23311b92755ffa9087332d1bb8c71c0f6a10cc08 https://git.kernel.org/stable/c/3d79e3756ca90f7a6087b77b62c1d9c0801e0820