Skip to contentSkip to conversation

CVE-2022-50071: mptcp: move subflow cleanup in mptcp_destroy_common()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Jun 18, 2025

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

mptcp: move subflow cleanup in mptcp_destroy_common()

If the mptcp socket creation fails due to a CGROUP_INET_SOCK_CREATE eBPF program, the MPTCP protocol ends-up leaking all the subflows:
the related cleanup happens in __mptcp_destroy_sock() that is not invoked in such code path.

Address the issue moving the subflow sockets cleanup in the mptcp_destroy_common() helper, which is invoked in every msk cleanup path.

Additionally get rid of the intermediate list_splice_init step, which is an unneeded relic from the past.

The issue is present since before the reported root cause commit, but any attempt to backport the fix before that hash will require a complete rewrite.

The Linux kernel CVE team has assigned CVE-2022-50071 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 5.11 with commit e16163b6e2b720fb74e5af758546f6dad27e6c9e and fixed in 5.19.4 with commit 6139039c8fc5c9dbcdc3ad389b9a6d0cacb4d693
	Issue introduced in 5.11 with commit e16163b6e2b720fb74e5af758546f6dad27e6c9e and fixed in 6.0 with commit c0bf3c6aa444a5ef44acc57ef6cfa53fd4fc1c9b

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-2022-50071

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/6139039c8fc5c9dbcdc3ad389b9a6d0cacb4d693
	https://git.kernel.org/stable/c/c0bf3c6aa444a5ef44acc57ef6cfa53fd4fc1c9b