Article View: linux.kernel.netdev
Article #20925Re: [PATCH ipsec] xfrm: iptfs: force a dst reference before queueing an skb
From: Steffen Klassert
Date: Mon, 23 Nov 2026 11:23
Date: Mon, 23 Nov 2026 11:23
34 lines
10998 bytes
10998 bytes
On Sun, Nov 15, 2026 at 08:26:11PM +0700, Nguyen Ngoc Thang wrote:
> iptfs_output_collect() is the dst->output hook and runs under the
> caller's RCU read lock. It queues the skb and sends it later from the
> iptfs hrtimer. The skb may still carry a noref dst, e.g. one set by
> __ip_queue_xmit() via skb_dst_set_noref(). Once the RCU section ends,
> nothing keeps that dst alive.
>
> When the timer fires, xfrm_output_one() calls skb_dst_force() outside
> any RCU section:
>
> WARNING: include/net/dst.h:326 at xfrm_output_resume+0x41d9/0x64e0
> Call Trace:
> xfrm_output_one net/xfrm/xfrm_output.c:549 [inline]
> xfrm_output_resume+0x41d9/0x64e0 net/xfrm/xfrm_output.c:597
> iptfs_output_queued net/xfrm/xfrm_iptfs.c:2325 [inline]
> iptfs_delay_timer+0x3803/0x4310 net/xfrm/xfrm_iptfs.c:2362
> __run_hrtimer kernel/time/hrtimer.c [inline]
> __hrtimer_run_queues+0x3bc/0xa10 kernel/time/hrtimer.c
> hrtimer_run_softirq+0x1e3/0x2e0 kernel/time/hrtimer.c:2153
> handle_softirqs+0x265/0x8d0 kernel/softirq.c:669
>
> The warning also means the queued skb may point to a dst that has
> already been freed.
>
> Take a reference with skb_dst_force() while still under RCU, as other
> deferred xmit paths do, and drop the skb if its dst is already gone.
>
> Fixes: 0e4fbf013fa5 ("xfrm: iptfs: add user packet (tunnel ingress) handling")
> Reported-by: syzbot+622de7e1f18a30fc404a@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=622de7e1f18a30fc404a
> Signed-off-by: Nguyen Ngoc Thang <ngocthang2710.1999@gmail.com>
Applied, thanks a lot!
Technical Details
Message-ID:
<awQiN-6b40NOCVFV@gauss4>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369283-linux-kernel-netdev=dewy.ruReferences:
<20261115132611.427311-1-ngocthang2710.1999@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-369283-linux-kernel-netdev=dewy.ru From: steffen.klassert@secunet.com (Steffen Klassert) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH ipsec] xfrm: iptfs: force a dst reference before queueing an skb Date: Mon, 23 Nov 2026 12:23:35 +0100 Organization: Usenet Network Message-ID: <awQiN-6b40NOCVFV@gauss4> References: <20261115132611.427311-1-ngocthang2710.1999@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Injection-Info: usenet.network; logging-data="3861561"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:CV+l47DwaEJcHpCsMk2XcllP9Rk= sha256:LQloD3um5zQXKR0HT+VR8fCic+FF9dqXfKPoICOBJHY= sha1:ubQ0LRkRhdccdy1xxSD8LQfkHPw= sha256:EVjEhNgyaRFSg2kQXe7vuieeqQRJYqbsZe690fxLKfw= 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 49EE1125DA0; Mon, 23 Nov 2026 14:23:56 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 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, 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-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=secunet.com 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 kBAPIC5DAfyv; Mon, 23 Nov 2026 14:23:52 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-369283-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=secunet.com X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 1E574125D9F; Mon, 23 Nov 2026 14:23:44 +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 D53DE38CBA; Mon, 23 Nov 2026 11:23:41 +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=1795433021; b=GblCI4eOQLK7NIXgE0VbR9coUkCR7OHrEVu9nwQdLtDyUE0y+7DqalFxjrqRMLvmpYot NDfD2RktbtTpH08/R181xMWQ5VIalvffDYSc/VqxPiVNOxgWrJklmDBnPDF/2tqklBz1Q sLZqDnDQ67CF/dPC+0Dn9QmRQm+W+6qRGVK1U5x/wWA0SQY7FmN5m5pH2E9K183U1AEAz 40SMXDHane0p19qtg5NTJHYpwjaKcxUKA3loCo5OvOGGIsk/qgqbYLtrPd1NUyNnlGX3j cTvVF+t6etzorJB+tRo1gZaoL+xwbjHn9M7C8/zxudH04MpJ7/piXmvpPjAXDnefoEA== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795433021; h=X-Original-To:Received:DMARC-Filter:Received:X-Virus-Scanned: Received:Received:DKIM-Filter:DKIM-Signature:Received: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: X-ClientProxiedBy; bh=Bum+lssZPEFatuL2bG+N1NnJsQw7nXk0ur3WJ+ACVtg=; b=cjD+Yo4TuJlDLOlV9myCJlY+Q6cXfkPqN+OLbsPlusb+G/k3prFzUgjMgXV8HmO8iHvP PWQ6PTYxlm0mn84LrLmTGs+8MVW+XBmJycECDPCo3CkHq0snJvWh8tw6GWPP+M+8ZQB8d 4DLYMkmGSV6puvcSKaw29+oEwSX+9rxeEWzrAFheU1lICrmz8B/qMuPM/rQ72LFtS11ca gvUNI6sEGVmuOB8aKhaDszjtorSHRUr18arnoR+isiQ6JYsnsvB8V0wZGaJ0QnWtrMPf2 VTv+K0PS7QnyqPMbGXIo2iiYivQiR2fLorIwVSaqulcxZc/OCgtH9sFe6AVNrLt7yAw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=secunet.com header.i=@secunet.com header.a=rsa-sha256 header.s=202301 header.b=HzqUGRGG; dmarc=pass header.from=secunet.com; spf=pass smtp.mailfrom=secunet.com; 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 03037606A31F; Mon, 23 Nov 2026 11:23:41 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=secunet.com header.i=@secunet.com header.a=rsa-sha256 header.s=202301 header.b=HzqUGRGG X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=62.96.220.36 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795433020; b=Gxkl3kasrjBNBoBnZaLgsjlfUl1syEMTTMtCvfgudllfI31DB0UhUvNWsej3ZW35VOAG 5LptVIJrvg3x9T6fliBAitcu3/iT2S+FBXlHJhAZ8sr2LbXEofiLvNGnRxxy0NjIbViPs Llcp65V7paiPF/hJig1I9P/mPcmdTZFLY5/3gi3lUblL+2wxl+mheSqOES9RedbuBlBn3 Rv1OMhUAehDX/lYIRknEnCV8POaoQDsngxmlPSFcQ3QFhKSogE8gHuo7IMCfc0fhzYHC5 cPJijEsysNE3sXEmT9AKAQRlZ4bkIFvUP2bBtJAKd0214a0jbGvIHafDuKlmZy7xhFw== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795433020; h=DMARC-Filter:Received:X-Virus-Scanned:Received:Received:DKIM-Filter: DKIM-Signature:Received:Received:Date:From:To:CC:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To: X-ClientProxiedBy; bh=Bum+lssZPEFatuL2bG+N1NnJsQw7nXk0ur3WJ+ACVtg=; b=TDOuEQC8J92EudVTZxDhIUBqMFGIJLH2BqLCIw2tnNBnKTIi0fUFyZto6vt7h3YmNntm Rmc+btlXvhFK14gHZWEa9QByql+vMEOFe8zoobvS4YAoyt/2EjGymDjsYm15+xAUtsS4g PhYnR0zcEXN0KpCaP08+CHDE1V2BQ5Jj30sRpv0AfdZoChFUj0RQo93YIIB7vy9fQ2KZc s16aNCuYsP/WlFMNGtsF5BqYPZcOs+A8Y95+6NugnyWdJssrKH40zIPXWwlriWiGCpKEL Z9/9xQo7MBlKKx1/UhZoL/o56wrKrGR9qEpgxcv8tqsIUhS61YXesUAybTh+JwhLbQg== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=secunet.com; spf=pass smtp.mailfrom=secunet.com; dkim=pass header.d=secunet.com header.i=@secunet.com header.a=rsa-sha256 header.s=202301 header.b=HzqUGRGG; arc=none smtp.remote-ip=62.96.220.36 X-Received: from mx1.secunet.com (mx1.secunet.com [62.96.220.36]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 612E9606A31E; Mon, 23 Nov 2026 11:23:39 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 612E9606A31E X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=secunet.com X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=secunet.com X-Received: from localhost (localhost [127.0.0.1]) by mx1.secunet.com (Postfix) with ESMTP id 8950020728; Mon, 23 Nov 2026 12:23:37 +0100 (CET) X-Virus-Scanned: by secunet X-Received: from mx1.secunet.com ([127.0.0.1]) by localhost (mx1.secunet.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id REJH_RAY6Ms5; Mon, 23 Nov 2026 12:23:36 +0100 (CET) X-Received: from EXCH-01.secunet.de (rl1.secunet.de [10.32.0.231]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.secunet.com (Postfix) with ESMTPS id A3DC9201C7; Mon, 23 Nov 2026 12:23:36 +0100 (CET) X-DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.secunet.com A3DC9201C7 X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secunet.com; s=202301; t=1795433016; bh=Bum+lssZPEFatuL2bG+N1NnJsQw7nXk0ur3WJ+ACVtg=; h=Date:From:To:CC:Subject:References:In-Reply-To:From; b=HzqUGRGG69t1azuhLafPq7isOoKAcz2QJREEgF44pc92J4ctrvIi9y7YJjsenc8Sr d1zizrlAdlKomgV1OMLUtzqkkPsjviu8UzWpr8BGV+UypsVR/7p8nRdk5L/Wm4zvIg EOwK0wswzgk2AG/hX5KUdjm3pWfP+inIs9+vhEGJ0ZBRDPg7ClEq9LTovzD0Wv0W7i PMB5hBjVlXuPRxZzAFx/1vRO1DPOSUWnPqaktxcX8S/VeucVY+dlzpEaJ4S//1kwUB jiHxViEnLbKy9cqoVdOTePhjMKFqelrnsNq1q1h/ZU0+SaqwQvEtZnF6IRRJjP3WXy qgyzQFKn4R0wA== X-Received: from gauss4 (10.182.7.102) by EXCH-01.secunet.de (10.32.0.171) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.49; Mon, 23 Nov 2026 12:23:35 +0100 X-Received: (nullmailer pid 2092840 invoked by uid 1000); Mon, 23 Nov 2026 11:23:35 -0000 X-CC: Herbert Xu <herbert@gondor.apana.org.au>, Christian Hopps <chopps@labn.net>, "David S . Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, <netdev@vger.kernel.org>, <ipsec@lists.linux.dev>, <linux-kernel@vger.kernel.org>, <syzbot+622de7e1f18a30fc404a@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: <20261115132611.427311-1-ngocthang2710.1999@gmail.com> X-ClientProxiedBy: EXCH-02.secunet.de (10.32.0.172) To EXCH-01.secunet.de (10.32.0.171)