🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #9764

Re: [PATCH v2 net] inet: frags: limit the truesize of a reassembly queue

#9764
From: Jiayuan Chen
Date: Mon, 02 Nov 2026 15:22
29 lines
9477 bytes
On 10/30/26 4:12 PM, Eric Dumazet wrote:
> The truesize of fragments in a reassembly queue is only bounded by
> the per netns ipfrag_high_thresh sysctl, which has no upper limit.
>
> inet_frag_reasm_finish() sums the truesize of all fragments in an int.
> If this sum reaches 2^32, it wraps, and the final sk_wmem_alloc
> adjustment of the socket owning the reassembled skb can cancel its own
> reference, leading to a use-after-free of this socket.
>
> This can be triggered from an unprivileged user/network namespace,
> raising ipfrag_high_thresh and using padded TUN packets, which keep
> a large truesize after being trimmed by ip_rcv_core().
>
> Track the sum of the truesize of fragments in each queue, and refuse
> a fragment that would make it bigger than INT_MAX / 2. Callers kill
> the queue on this error. This bound is far above the needs of
> legitimate traffic.
>
> Fixes: 18685451fc4e ("inet: inet_defrag: prevent sk release while still in use")
> Cc: stable@vger.kernel.org
> Reported-by: Kyle Zeng <kylebot@openai.com>
> Cc: Florian Westphal <fw@strlen.de>
> Signed-off-by: Eric Dumazet <edumazet@kernel.org>



Reviewed-by: Jiayuan Chen <jiayuan.chen@linux.dev>
Technical Details
Message-ID: <d108788e-bd69-4bc2-aca5-d8080fea818b@linux.dev>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-354864-linux-kernel-netdev=dewy.ru
References: <20261030081225.2575462-1-edumazet@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-354864-linux-kernel-netdev=dewy.ru
From: jiayuan.chen@linux.dev (Jiayuan Chen)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH v2 net] inet: frags: limit the truesize of a reassembly
 queue
Date: Mon, 2 Nov 2026 23:22:18 +0800
Organization: Usenet Network
Message-ID: <d108788e-bd69-4bc2-aca5-d8080fea818b@linux.dev>
References: <20261030081225.2575462-1-edumazet@kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit
Injection-Info: usenet.network;
	logging-data="2969736"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:FWpNwcU9C6uyNQ8Cu87FOmkek9c= sha256:/JtqsSX7ZTimpgJKSWsh2YOQaZMkSM21jkobAAAProA=
	sha1:WrBQBNFY5Tjn2I+RtJOgMbhcWh0= sha256:JO5BQ/owqzxHzcuZ+uSgZmmI2WRmZP4i6hWe21z/slY=
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 026CF11259B; Mon,  2 Nov 2026 19:35:50 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -2.051
X-Spam-Status: No, score=-2.051 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	HK_RANDOM_FROM=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 (1024-bit key)
	header.d=linux.dev
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 hZM2DUJpqPSu;
	Mon,  2 Nov 2026 19:35:47 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-354864-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linux.dev
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 1D58E112595; Mon,  2 Nov 2026 19:35:35 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by tor.lore.kernel.org (Postfix) with ESMTP id 870CA103D80; Mon,  2 Nov 2026 16:08:58 +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=1793632951;
	b=gf+K92FRUFp7+MvEEEBrdK4PEf+6Liwtd0QiXPe2JWVHL9BZ5mbpQFCkTcdour0SxLXX
	 nuUkpcwSSRV5jz7rF+Mk7rgoEFt39KqUR1jq15kXQ0Gzxj74FvxRGsnLAP/Xy1CsMfkwf
	 R9RSPhBv0bGP3BVPFv3gjKeYtNOLNqM7mshZq7xSHSbqHwZnypPvDMh2BT2XClOaaL10R
	 K+Nflt//aLWG5Vkmznp9cGx0s5BWWsbnvsUy7L9n/cTheIUSD0n8RfPUKEalOsoXpOo/e
	 3/s2hCTZWakWh3/8MR9izpYkeW54gQaIAr1x5r7lvVkBrn3e89s4Hu03XPXWPcjBJ4w==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793632951;
	h=X-Original-To:Received:DMARC-Filter:X-Envelope-To:DKIM-Signature:
	 X-Envelope-To:Received:X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:User-Agent:
	 Subject:To:Cc:References:From:In-Reply-To:Content-Type:
	 Content-Transfer-Encoding;
	bh=ODeQNKP0UJzemh4mAsPTNTViZ9w8JQQkxq+xVPOOp4A=;
	b=yxjGsaJGarBq16a9ibMOR1e/VBc1+P7By+qGZL3hRnoZ0Grv0qfHLZc7sKoF/hgAZQfs
	 aPCPKEzUKCK9GAoZCg8YxxTwxVWSmHOyigAaqEsIOZiwvhxHLRpsz/uezdoO6dVSSEp+y
	 ABE231/cLucgHd79/kUxQaxjNoT/uiDneORyhtikmCGN+2fkofVAL+bfnNHIexGsa09jW
	 VC/gAV7KjoE2gQ2JZO//YYRtdaJM41pZVBTcqRHHWkMijdL6BRHDFhy3czlFbt5YeLnJA
	 OB7DBa5LcKNP0f5ALEahUTE4p1bXOANgeLs28pEu0JuGZw8ffOqmlOCUuYYvRK0W6/A==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=MkPK98Gk;
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	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 3F606608059E;
	Mon,  2 Nov 2026 15:22:31 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=MkPK98Gk
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.120
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1793632950;
	b=UKL0RXV6eUut2BQpp75AxqGaZKHNltiZ1n5AHEcwObphh6kqVlhptujpo7LY04CcxUyX
	 fZnO6CUoE/fypKrANEakkMEPgB5hBo3DKBJ8xiBbtb8I+mDJOmnEaD94zqaZUDuESD/Ir
	 WObaTBVvhJsRcbffH99tqMg7RPjv7ifDIlLxOiSkrLUCTA5Fcv6EajdB7sP/6e8fBXzdp
	 7UTevGuTQjoKUOJiPdU3jc22yBAd2PY3efbnWdsTJir2pzu+UcaLCCy1Rqsyp8J3ePBk/
	 x/oXqkZfLk5pYKnbVKWn001fGALQ5rfZcEz/S4fsaKaX2zjvtiwX2sIPVSnNobhlmlA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1793632950;
	h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received:
	 X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent:
	 Subject:To:Cc:References:From:In-Reply-To:Content-Type:
	 Content-Transfer-Encoding;
	bh=ODeQNKP0UJzemh4mAsPTNTViZ9w8JQQkxq+xVPOOp4A=;
	b=UC8Gycnp7eRoHuwN16AZGLclm2Ktfb+jfHZ/4sAWSZvqByxytN9KEdfsT3Wb2iF+M8Yc
	 1VwMWKJ+ptsNvnegSnaohuymyXhwRQGYeM7Q7eFwbVJLoppr+sS+IlVoHl/nu68FVzrNQ
	 s7hS9wawUlzwW1j01h3l44OSn02AHw+qp0zDQW2EcZxtk7dsnT8JlZEmlYu4jrXIaH6si
	 WZ7kX8uq0aURkw7fXjdgb7HAGtHGjK8odsQKT6kIm1AnbDF2hRshwftJWwMWqYMEnM+xG
	 TW7vWdUuoyB0/bdwtm6z8GKGv9Y55hKPuAnWmNHwmjzoFr3CdtBN7+UvWHT7NNpsAMA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=linux.dev;
	spf=pass smtp.mailfrom=linux.dev;
	dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=MkPK98Gk;
	arc=none smtp.remote-ip=91.218.175.120
X-Received: from mta0.migadu.com (out-120.mta0.migadu.com [91.218.175.120])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE71B6070DB0
	for <netdev@vger.kernel.org>; Mon,  2 Nov 2026 15:22:29 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AE71B6070DB0
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev
X-Envelope-To: netdev@vger.kernel.org
X-DKIM-Signature: a=rsa-sha256; bh=ODeQNKP0UJzemh4mAsPTNTViZ9w8JQQkxq+xVPOOp4A=;
 c=simple/simple; d=linux.dev;
 h=from:to:subject:date:message-id:mime-version:content-type; s=key1;
 t=1793632947; v=1; x=1794237747;
 b=MkPK98Gk6+VtkxKxcLCiTZ79pZE+KHJ10FDlU0JuKqId69E4Br9BDm2UG5xM2pXu6bh8SDK/
 l/Cyoh85ozVnbJj2YmWmmk2CpYSnM3Uh3ew27r3OqktJwvxXv4J0LhnPVerVbbdrI6+WMLyqwPq
 y8ALbIKiQlQ+YNE2I9BMpwvk=
X-Envelope-To: netdev@vger.kernel.org
X-Received: by smtp.migadu.com with ESMTPS id e6dff1b99e2386a3;
	Mon, 02 Nov 2026 15:22:27 +0000
X-Mizu-Trace-ID: e6dff1b99e2386a3
X-Migadu-Flow: FLOW_OUT
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
X-Cc: Simon Horman <horms@kernel.org>, David Ahern <dsahern@kernel.org>,
 Ido Schimmel <idosch@nvidia.com>, netdev@vger.kernel.org,
 stable@vger.kernel.org, Kyle Zeng <kylebot@openai.com>,
 Florian Westphal <fw@strlen.de>
X-In-Reply-To: <20261030081225.2575462-1-edumazet@kernel.org>