🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #19337

Re: [PATCH mptcp-net v2] mptcp: fix use-after-free of the subflow context on the delegated list

#19337
From: Matthieu Baerts
Date: Thu, 19 Nov 2026 19:13
33 lines
12254 bytes
Hi Hyunwoo,

On 04/11/2026 03:52, Hyunwoo Kim wrote:
> mptcp_subflow_delegate() links the subflow context into a per-CPU napi
> list and takes a reference on the subflow socket. The context is a
> separate allocation, reached through icsk_ulp_data, and the list holds
> no reference to it.
> 
> inet_csk_destroy_sock() runs sk_prot->destroy() regardless of the
> outstanding references. That path ends in tcp_cleanup_ulp(), which calls
> subflow_ulp_release(). subflow_ulp_release() frees the context with
> kfree_rcu() but does not remove it from the list. Once the grace period
> elapses and the context is actually freed, the next mptcp_napi_poll()
> dequeues that entry and mptcp_subflow_delegated_next() writes to the
> freed context with list_del_init(). That is the use-after-free.

Thank you for this new version, it looks good to me:

Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>

Sorry for the delay. Please next time either use 'mptcp-ne(x)t' prefix
and send the patch only to the MPTCP mailing list (without netdev), or
use the 'net(-next)' one with the netdev ML.

@Net maintainers: If it is not OK to apply this patch directly in -net
because it is too late or because netdev maintainers have not been CCed
(which I understand), I can send it later with other fixes, no problem.

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.
Technical Details
Message-ID: <4e209707-bdc4-415a-923b-4ac1d2006ecf@kernel.org>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367277-linux-kernel-netdev=dewy.ru
References: <auqd0rAI95jDSMvu@v4bel>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-367277-linux-kernel-netdev=dewy.ru
From: matttbe@kernel.org (Matthieu Baerts)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH mptcp-net v2] mptcp: fix use-after-free of the subflow
 context on the delegated list
Date: Thu, 19 Nov 2026 20:13:23 +0100
Organization: Usenet Network
Message-ID: <4e209707-bdc4-415a-923b-4ac1d2006ecf@kernel.org>
References: <auqd0rAI95jDSMvu@v4bel>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="2959821"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:suUqNqGfUNc30e0jbFIWNyXHb+U= sha256:/393WMmMvxkBq2cDR1r4ifsNT+4GkKsNi3CgFiAg1tM=
	sha1:uWuOCdouHcQLJ8Vv2v+LZvfadk8= sha256:VuGwpJe8bJs/FL+CCHASAAP4V8QywAy1GyFIa+Up9fI=
Content-Language: fr
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 9B72A11574F; Thu, 19 Nov 2026 22:13:44 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id gn_10BB7b1H5;
	Thu, 19 Nov 2026 22:13:41 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-367277-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 1239D11573C; Thu, 19 Nov 2026 22:13:30 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 66CD8184E08; Thu, 19 Nov 2026 19:13:28 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795115608;
	b=lexg0yfrpZiZuYGCdudOzXKcPo5df5xqs5tXWI7VnYEZCkdfUvtz3xXzMZCnbvwjQv+X
	 g85reV0zFUfqIg+6M7W6K1F7jwmsvzDLMB12Wz8kjmDYGPEgeL3y/t+zJIM8t7RaPpNEC
	 CIl4PFETZracV6ociAd18wSi7ZOGmQyvuHKX2BbGtmjmAEXxxvGhtyU4t4mVuwhwjMJ/x
	 lJZ7zsjg+tKCn+nGEgMQuPigXRWaqFRmTzrKyI/ww3TD7wufj5MaoYOAQKa9uY5OzjXZF
	 dRdUYK1ZTrFTdnSFgFuMR7fE6kEP6ddfb+3RNexVaspZLQNdDhCOII7d4KOyobY1ZhQ==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795115608;
	h=X-Original-To:Received:Received:DKIM-Signature:Message-ID:Date:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent:
	 Subject:Content-Language:To:Cc:References:From:Autocrypt:Organization:
	 In-Reply-To:Content-Type:Content-Transfer-Encoding;
	bh=MvW/Jus/Vy01lP2emx24/z5kIpS0Aon4QH2fAoEv36c=;
	b=q7rRu8m3jFJ9fjllUh7QUp1cNOBiOW8I09C5I91Yw0pRll8MbTfJXGc7RO/f10bhwkmd
	 MpUSCC78POohmBGTBGZkW+gL+D6QS/ND0zTFa/T9a+to+eoKN+qZFhVZrByLt99UomGRw
	 aatMIwL22FKne3d9zteLnrXKwUEupt7U+3jIGrWtyH1gUGMN8qdSYs05JvMowOO9YHj7w
	 IFJAyk55Y8ng2xE7R+Hw+6Wgbi5C97teAnHL5WIw8p+Y7cvA4QhkEWWH+N85oirBCM5lv
	 sMjchZavS6Bvs4VhQdCLrEQFGUDGd29szUMS4qfARuK9UQOCI0sxxSlVrmepy8/qb6g==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DMHgwxll;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 3E7C1606A324;
	Thu, 19 Nov 2026 19:13:28 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DMHgwxll
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795115607;
	b=EQxcymzY7Okp42guRoblJj5gjKjqqvBq/r2XI4Rkn9nAsfY7XcaVdH0W/bOItoGqaaYE
	 FYKycrgNVqh9YaPk0ORl6cQYNyP4GLmbczCUr0jUKNVJ6xJmjv0YzjLSOoGcnVb6kaSp2
	 x69XyShALmWPyhd7VkprM4rZBZVZAkefO5TyhkTA0TD7iMn8GG+BYoLOc+9BTjlxNvnaA
	 GdAMh1N1A8fk02fqHh4JC220D34WMkBjAMJbmZvSoT7Vs2aiDawB6goZTbFvF0naPjaj9
	 fSh1Db65sXsiU6m2O1AHocS2asO9YEIbeNxap8CwA6SvEyNLahonPwy5r5pXyUCaf6A==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795115607;
	h=Received:DKIM-Signature:Message-ID:Date:MIME-Version:User-Agent:
	 Subject:Content-Language:To:Cc:References:From:Autocrypt:Organization:
	 In-Reply-To:Content-Type:Content-Transfer-Encoding;
	bh=MvW/Jus/Vy01lP2emx24/z5kIpS0Aon4QH2fAoEv36c=;
	b=qdFqhvWW7NwE1YEdJCdq5cBp6CTR7s6F6I3nLAsgVPZRtX1jZvtHCt86l5OX+LWCQt24
	 RJXv7hbiICf+h9WZenCtfaZacdrTvvd4murfajHJRy/5VjfmEp8EZ6oDwcYTJ67613S/B
	 tbCLZHwyXyHHC5hdahn2gcsf5zUzqopcU4G0kGDI0NfeNQb1E0YroCIOLWBchn/qecbIF
	 QycWRtRiaw9CZtg+wJVqF1bHwqjqewmCbfM7sEOJkVFn5/6sHzA/+hWWX3xZjXWruynTc
	 j5VVhh6jYE5DVgHj8tjsEPhVQdhY17XCuqxaVUx+ap1tuaNY1K1lK/hnKqUYkNH/NuA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=DMHgwxll;
	arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1))
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C457606A326;
	Thu, 19 Nov 2026 19:13:27 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87F761F000C4;
	Thu, 19 Nov 2026 19:13:25 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
	s=k20260515; t=1795115607;
	bh=MvW/Jus/Vy01lP2emx24/z5kIpS0Aon4QH2fAoEv36c=;
	h=Date:Subject:To:Cc:References:From:In-Reply-To;
	b=DMHgwxllkYhaRHRdCwNqXYuwf1Bw0e+myLQ26IS/qULLAoAqqNqvJNYFHqUcMk3PP
	 GbOt/KQCzxzNHJ8BVjlfWj8hYn/+95FKcxMM8NYP9Yk/ybga2kMXthTMPRpH7Apps3
	 11c1vNCBvrrU/+HNEmeToQ2z4m7Esg/COKoFAEoumPYm6lk+DE3vEZYH0MOO2tH3Fi
	 6b0BP5KMm0gtqmOGq9LMQwpihumPobgRnL5TsoPxQEv1+n0tF9s2ZAa0tayYm/Z+Je
	 1aQcswkGk4wgwZYbO4B0BzqrBwZPXJRiRnnXkUctjQBfj2sMMcAeCRmgxueiYrpgV0
	 mupAJbl20p/Pg==
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-User-Agent: Mozilla Thunderbird Beta
X-Cc: martineau@kernel.org, geliang@kernel.org, pabeni@redhat.com,
 mptcp@lists.linux.dev, netdev@vger.kernel.org
X-Autocrypt: addr=matttbe@kernel.org; keydata=
 xsFNBFXj+ekBEADxVr99p2guPcqHFeI/JcFxls6KibzyZD5TQTyfuYlzEp7C7A9swoK5iCvf
 YBNdx5Xl74N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