🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #17776

Re: [PATCH net] netfilter: ipset: exclude add-path GC during resize

#17776
From: Greg KH
Date: Tue, 17 Nov 2026 09:57
34 lines
9367 bytes
On Tue, Nov 17, 2026 at 06:27:31PM +0900, onLeaf wrote:
> mtype_resize() copies elements to the new table including their extension
> pointers. Garbage collection of an expired element in the old table after
> the copy therefore frees an extension still referenced by the new table.
> 
> Commit cffcf57bf03c ("netfilter: ipset: exclude gc when resize is in
> progress") prevents the delayed-work collector from running during resize.
> However, mtype_add() also invokes mtype_gc_do() directly when its target
> region is full. The packet path can enter this call while a userspace
> resize is copying the old table. It then frees the old copy's comment, and
> collection of the published copy queues the same object for freeing again.
> 
> An unprivileged process can reach packet-side ipset add with CAP_NET_ADMIN
> in newly created user and network namespaces. The resulting duplicate free
> was reproduced with KASAN on x86-64 and exploited from UID 1000 to UID 0 in
> the initial user namespace on a non-KASAN build.
> 
> Serialize the direct collector with the same GC lock and honor the pinned
> table's resizing flag, just as the delayed-work collector does. The table
> remains pinned by uref while the lock is held.
> 
> The issue was found through AI-assisted source review. On the fixed kernel,
> the same copy/old-GC/publish/new-GC ordering completed without producing a
> duplicate object; /etc/passwd remained unchanged and the test ended in
> LPE_FAIL.
> 
> This change was prepared with assistance from OpenAI Codex.
> 
> Fixes: f66ee0410b1c ("netfilter: ipset: Fix "INFO: rcu detected stall in hash_xxx" reports")
> Cc: stable@vger.kernel.org
> Signed-off-by: onLeaf <onleaf322@gmail.com>

Real name please.
Technical Details
Message-ID: <2026111728-deduct-chastise-eac8@gregkh>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365147-linux-kernel-netdev=dewy.ru
References: <20261117092731.14656-1-onleaf322@gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-365147-linux-kernel-netdev=dewy.ru
From: gregkh@linuxfoundation.org (Greg KH)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net] netfilter: ipset: exclude add-path GC during resize
Date: Tue, 17 Nov 2026 10:57:38 +0100
Organization: Usenet Network
Message-ID: <2026111728-deduct-chastise-eac8@gregkh>
References: <20261117092731.14656-1-onleaf322@gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
	logging-data="2298055"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:eM86t0lel4gJsr+4cXvd79dpjnE= sha256:O1+lf0bJTZk+7hcLiRYy33exruCs1F1umNC6xFPCvao=
	sha1:UmDZOLqLFmUc0BGQjMDIYDjDInU= sha256:2ta6MvdXLYKJOI9SNa+ju4Ml+LqmSPiw4AgAjUKJfo8=
Content-Disposition: inline
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 B983B114EEF; Tue, 17 Nov 2026 12:58:10 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.052
X-Spam-Status: No, score=-3.052 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,
	HEADER_FROM_DIFFERENT_DOMAINS=0.249, 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=linuxfoundation.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 RXfq176syWvW;
	Tue, 17 Nov 2026 12:58:07 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-365147-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linuxfoundation.org
X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114])
	by mail.dewy.ru (Postfix) with ESMTPS id 39182114EEE; Tue, 17 Nov 2026 12:57:58 +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 E2C022C1AA; Tue, 17 Nov 2026 09:57:54 +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=1794909473;
	b=SQweY0BmTL4UWInVT/0ZeGpmzEOjzagDbiYDGpiJf0FC/3HsB96U1eJrHM99LIyyHfir
	 w5RALkMpJqZ4UkUdrrcWzWRaD9fmJfVhNOxcvCY7VW/aAyJH0l2UdXj3JW6IYf8lVHABD
	 2+as84p1VdEctpvAwsVE5EDIQPzzMi0s6nQVj5VaJ1LosQW+aYRd77F7Zbs/C9Y4Dr2L1
	 QPIGrqx8Zc2yoR0GPmEea8GFu3VQxoEadgHVvbGSBVSoK4JFpVp1ACaqtSq1Sfudo3vND
	 QL+ar3vTJhhoYfof/K9RnxsJwG/75lVpMYntfu/8gqPz2c3DBSB4TCXy2miPiNgbeaA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794909473;
	h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc:
	 Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post:
	 List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
	 MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=NPBCRni7dqPhXV3m0qj8RnZnSgSXxrY9Otftjlz4nOo=;
	b=i2RqfoZJfct1WaCud8ycn2KoAf9PfJuml7qWGcAt9HIVBmBmMP0SfvsJVFbl95L5H2k2
	 2Zu5BCqDS/tePmvHEJCRuiufH853QYTPC6QFLn/UtTn2F+6l3ssDwd1BfFsapnxP4r4NG
	 pXYFJOIAFZKa/gaWUOsldVw2m+JI+3M/ESrgOBlMbNYh4TmnU1waSAOpbGQ8ocLkhk6r4
	 VBRhcPrSgBvWy1a4Y7E+Q2sC6ECSjJXnAHdm7yxX56kkpFkDccD4oHr1OYPS65VOB7Rdl
	 B33jgpxJYzIOt4mJc2hBiI56449CfdB7oF6Dl60KR6HoeSLN2oSy8F3zCVsSlf36G8g==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=U2b2zNJG;
	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 A034A606A33E;
	Tue, 17 Nov 2026 09:57:53 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=U2b2zNJG
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=1794909472;
	b=Uek32839yZyHXcabLC2X91TzQMyoKuPrUvkqGj4BVKz+RFsxk6f6z5RgEe4Gdi4l5Nur
	 kAg4DlAIQ1gqU2dRClc+4RtNF0sGRYfKZ6oSXe8VXs+wbr58UUfKFL61MVgptOIzAUuBN
	 For25aF3KIavWeCcWeK7ylTagOT+0z413Q2O9ilh9TYi4NiiuFq4i65FUenubPalaFsjZ
	 3Vin8jt15bNsnEG0MxOrFJ+QVqdxXkqgvaQR+1cGnE4Y0/f53MPSl5BtL3W4GQWvuodAC
	 LjB55KW6OWAWizql1A60R9/TSndWe9048p8RMwK1ySXdW+ALUQ8d3ZAzZxI7IlMjV8Q==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794909472;
	h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID:
	 References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To;
	bh=NPBCRni7dqPhXV3m0qj8RnZnSgSXxrY9Otftjlz4nOo=;
	b=oNbNN6LypXBKl7QmIJyAxL8TObf4AeVtw4Ak7y1PAYbNlw/b4FilCk1INhhlG1MJOSI+
	 MOnJwK9nonx8Csf8hR5bhbWZccHHY3y2FTR56WHEg4CExX4ITF3abvSA0JBaOBbUSQn05
	 a0KMD8oJ2KT5dCInL5owuzgYcC8zchRuZ7kyHZpin8qOCWIzr08cuOrQoXA9MyfTeWaGa
	 eX+dK3FU9PmLZKhU+RcGNQtVSZrrvB+WEKbc/CxPX4JMDIbIzMYZBtwVKqF+amagUnBpd
	 6HyVNbrmAu9VwaPOy7x/lJXc5pFEOsfir0wBPLmTF8JWyrRZFyFISWj0q58LZH3dHaA==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=U2b2zNJG;
	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 BEC7E606A31C;
	Tue, 17 Nov 2026 09:57:52 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id B51651F000C5;
	Tue, 17 Nov 2026 09:57:50 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org;
	s=korg; t=1794909472;
	bh=NPBCRni7dqPhXV3m0qj8RnZnSgSXxrY9Otftjlz4nOo=;
	h=Date:From:To:Cc:Subject:References:In-Reply-To;
	b=U2b2zNJGNI4HHyq2IiKuNP5On/KDos2GxvOOzL7wzeD/LOkKB+XKZkjk34oQ7gohm
	 CFLWgzBRnzY/Ba8Wa6c+J4OsIregkPa8Osw7EnAnV/h629VFJ+uWxftT+NE+jl8nuW
	 zS4qZ9xKBXp4zRjb6KCFryymTUYItGntvHsJPI10=
X-Cc: pablo@netfilter.org, fw@strlen.de, phil@nwl.cc, kadlec@netfilter.org,
	davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org,
	pabeni@redhat.com, horms@kernel.org,
	netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
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-In-Reply-To: <20261117092731.14656-1-onleaf322@gmail.com>