Article View: linux.kernel.netdev
Article #6407Re: [PATCH] xfrm: disable state hash resize work on netns exit
From: Florian Westphal
Date: Thu, 22 Oct 2026 10:48
Date: Thu, 22 Oct 2026 10:48
35 lines
8411 bytes
8411 bytes
Eduard Zateev <hackerowskiy@gmail.com> wrote:
> xfrm_state_fini() flushes state_hash_work before it inspects and frees the
> per-net state hash tables. A concurrent state insertion can queue another
> resize while that flush is in progress. The resize worker may then replace
> and free a table while teardown is still walking it.
>
> Disable and drain state_hash_work before flushing states and freeing the
> tables. This also prevents a new resize from being queued during teardown.
>
> Fixes: f034b5d4efdf ("[XFRM]: Dynamic xfrm_state hash table sizing.")
> Reported-by: syzbot+f3f4fce0609f8e91b540@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=f3f4fce0609f8e91b540
> Assisted-by: LLM
>
> Build-tested: W=1 ARCH=arm64 net/xfrm/ (out-of-tree build).
> No reproducer was available to run the teardown race locally.
>
> Signed-off-by: Eduard Zateev <hackerowskiy@gmail.com>
> ---
> net/xfrm/xfrm_state.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
> index e45aa1ed5b9..8a2e465bd73 100644
> --- a/net/xfrm/xfrm_state.c
> +++ b/net/xfrm/xfrm_state.c
> @@ -3392,7 +3392,7 @@ void xfrm_state_fini(struct net *net)
> unsigned int sz;
> int i;
>
> - flush_work(&net->xfrm.state_hash_work);
> + disable_work_sync(&net->xfrm.state_hash_work);
This is already done in xfrm_net_pre_exit().
Technical Details
Message-ID:
<atnp52JxdGXixDge@strlen.de>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-350515-linux-kernel-netdev=dewy.ruReferences:
<20261022102641.1429128-1-hackerowskiy@gmail.com>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-350515-linux-kernel-netdev=dewy.ru From: fw@strlen.de (Florian Westphal) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH] xfrm: disable state hash resize work on netns exit Date: Thu, 22 Oct 2026 12:48:07 +0200 Organization: Usenet Network Message-ID: <atnp52JxdGXixDge@strlen.de> References: <20261022102641.1429128-1-hackerowskiy@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="191884"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:dI82ESzujGCahOwpnpORWuDEglo= sha256:FNwwN2jiAFE398Rbt9BdsvP9nWXEClFJtBTBWymzzAI= sha1:vj7qoMtNCXrNrkJ9CODrbj5JHdQ= sha256:6mjUPf3EOqDIP4gdRIChe4qrUGmHHXGopv9MBj7wC/A= 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 B85A5111245; Thu, 22 Oct 2026 13:51:45 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -2.949 X-Spam-Status: No, score=-2.949 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.25, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no 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 3JZUrNNnpvCK; Thu, 22 Oct 2026 13:51:42 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-350515-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=strlen.de X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 9C1FD11122B; Thu, 22 Oct 2026 13:51:38 +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 5B97C2DFA7; Thu, 22 Oct 2026 10:48:18 +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=1792666098; b=Ld7X5l9jETzty+wojlAb6KdT7snjKVQIuor2tbsN+xs3zatTdyWt7EQZv3EchWUEwWko vnMptHLGTzXD948swVWh9mJ+9n0zzoLs0l4fqp6muj5Ti48NdMigQbyrwFv7ShSWmMYiT onTNqb8kJ9mA1dOlXX0187p3kMPjOu+p51UElPBM7O8amIgpDFtL9dZf8+jBDVWUsPGE+ fcDtzq3RVZP1L/ck3DIgY58dgAzQZbXr/XLmNsYGvpB0i5ISrvWhQXD+Q81Lt6OAFgP+P yNAFpXvxiwTRkpgYlyJPR9TQsRZq1hoSsBNM5+0uAffY6mbRJcYnW95vH3DSlrRWM2A== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792666098; h=X-Original-To:Received:DMARC-Filter:Received: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=gxHu+OsACNNKDOs52BFr5ziYno8vbDilu9o3NOvqrIs=; b=UfVW3eZqaoVtI0jkgNqa/GusC+pwJYGvkvdBiJY6/nMtRu+bnnvBGZLadozU1tnF8TUr Gxs+wUrp8mGLBe48tzeq/x+I8OhMESpTgnujkwH3r51dQw3POYXVDQ7hSG53M8amPHNIn bLT44P3rvBA/J9+PZUOwmt5B6SX1NQIGIyhACvTRATc4Er4r+wsAeGpgD3IC3i1yzxBX3 VJQxqbdJsFBEaiSzG5+RWRX3MbfSItKT5rDPg9K4/rOBbO+lGaXGm3LcPg7/ZzcmMAlir suzWbsjoEL8r5BZic6isXLAHu6ygIpUaZ0NjGlcSN0finnOyhm9Nsg2awHzH1/yI5sA== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=none header.from=strlen.de; spf=pass smtp.mailfrom=strlen.de; 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 3DFC7606A327; Thu, 22 Oct 2026 10:48:18 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.216.245.30 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1792666097; b=U9rBO42PEssPSuSrVt2vMQMw5lKrD40iEvn78gVLIoNTweNBcdJhWxV8omv9VsiLYCZq uNStCX1haINN3dTaBv6b/nrBJBlu3LjdOqA6agUkwncq1CE9qfwYRN96Mg04OfmsGIRkn iaWNZLf94e7VpRCkD7CbITudbXb5gTDzejhYPbTwlllKsZxazvyNWectVWIAnIi4QZiW4 a84LqP5Z0ar997H+8z8VEm9OeyOz1sIeMb6+cHPh3aUcPXbVTiaPSJbdTIyAt4ROMCE4o 9FYaxs0zjfkLaPxl0VrKPzWAl+mqlrZLFXjJSzQJPU1Ck2V2WVPoS9oGz6M84y+DfRQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1792666097; h=DMARC-Filter:Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=gxHu+OsACNNKDOs52BFr5ziYno8vbDilu9o3NOvqrIs=; b=uoxtXfMW9hfhsQpoI38asms/mQccWyOPT2ED1GUPRx/XeUeaF6mDcNqt2RpOEjEuOwFf WCChNY5HN1x0GsjXvWvUn+C942a5UmgQKh2cjax3xoC9pG/o58n45x+IPZeEKLeYK0uGq 8ZBTxTRPbZm9Vc/spkeNuRWs/0y6zlYDvJ3L6JxQgLMjbAtUm4STKjXUR8VY5ljwjj+qG qjWEgECaLtzdv1N3u/hJhMizBN78mcSCGqDn7sp+oOs5Hlm1lniOUxLPG7rXjorqiniM7 FDyHz0sRbPj5cToRw5BORhoCYO7Js0VAZYsYmVFrJD7oNjn5oBWGUa77WoJymkzDqqg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=strlen.de; spf=pass smtp.mailfrom=strlen.de; arc=none smtp.remote-ip=91.216.245.30 X-Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [91.216.245.30]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 325A6606A320; Thu, 22 Oct 2026 10:48:15 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 325A6606A320 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=strlen.de X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=strlen.de X-Received: by Chamillionaire.breakpoint.cc (Postfix, from userid 1003) id D066D60F16; Thu, 22 Oct 2026 12:48:07 +0200 (CEST) X-Cc: steffen.klassert@secunet.com, herbert@gondor.apana.org.au, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, horms@kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+f3f4fce0609f8e91b540@syzkaller.appspotmail.com 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: <20261022102641.1429128-1-hackerowskiy@gmail.com>