🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #5058

Re: [PATCH net v4 3/3] xfrm: hold the tunnel device reference across the input path

#5058
From: Qihang
Date: Mon, 19 Oct 2026 15:33
24 lines
11668 bytes
The [High] finding is valid, thanks.

__input_process_payload() reaches the drop label from several inner-packet
validation failures, and the drop label sits after the loop that delivers
the packets queued on @sublist.  When the outer skb is reused in place for
the first inner packet it is already on @sublist and carries the cached
tunnel device reference, so jumping to the drop label skipped delivery and
left both the skb and its tunnel device reference behind; the same applies
to a packet queued by iptfs_reassem_cont().

v5 drops whatever is still queued on @sublist in the drop path through
xfrm_input_drop(), so the reference is released.  The normal path already
empties @sublist, so the added loop only runs on the early-error path.

A revert-based runtime check agrees: with an aggregated IPTFS payload whose
first inner packet is complete and whose second inner packet has an invalid
IPv4 header length, v5 completes RTM_DELLINK, while the same code without
the drain leaks the reference and unregister_netdevice() waits for vti0
(Usage count = 2).

v5 sent separately.

pw-bot: cr
Technical Details
Message-ID: <1792424010.89978.05cf1ab60e@gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-348672-linux-kernel-netdev=dewy.ru
References: <20261018090638.55686-3-q.h.hack.winter@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-348672-linux-kernel-netdev=dewy.ru
From: q.h.hack.winter@gmail.com (Qihang)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v4 3/3] xfrm: hold the tunnel device reference across the input path
Date: Mon, 19 Oct 2026 15:33:30 +0000
Organization: Usenet Network
Message-ID: <1792424010.89978.05cf1ab60e@gmail.com>
References: <20261018090638.55686-3-q.h.hack.winter@gmail.com>
Injection-Info: usenet.network;
	logging-data="3680606"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:qZmls2PhkF+ilpS5VRP6/drhbBg= sha256:H8lD7V5sNJeYOkWlORZr99XHwl7lhr0NxhBGJARgtfM=
	sha1:j1/oqdBmPX/aoFfW/qplOwYapEU= sha256:WaoRRy+OKHyhU4WJZlPiNpF8Psqie9zVCMI8LSVfJ6c=
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 2779A110AB3; Mon, 19 Oct 2026 21:10:30 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.048
X-Spam-Status: No, score=-3.048 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, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, 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] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.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 1ABC7ld_8zTO;
	Mon, 19 Oct 2026 21:10:27 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-348672-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
	by mail.dewy.ru (Postfix) with ESMTPS id 012421109E9; Mon, 19 Oct 2026 21:10:18 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (aws-us-west-2-korg-listserv-alma10-1.taild15c8.ts.net [100.77.114.92])
	by sin.lore.kernel.org (Postfix) with ESMTP id 1EEC3167092; Mon, 19 Oct 2026 15:52:23 +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=1792424025;
	b=Yn6negZ/g0zTQurzwgtGK06vqd981at6tvfJNP96DXfIzic9iuHLUC/1BK5qUQNkNnck
	 fb0SDPtSKkYmCOZhFBLWz0jlw7sfGUUNrFLEq2CpW5e0UejO9hpu4/gbvAUvRzHDALvR/
	 gbtHqyvf0mONdTKz0EXOiW2ttxfPxi1deNaaS7XHfJ8fVs8yuYyQOV3YMjzsFKfPYJRxX
	 CNLDKTYa9LFDJOEqYybqRleR7npgMLCPfohJu6lcWrxJhzpTq7Ff8M+OyYeZ7sdHb8Cj4
	 9v4ltVj/5fI6Ix+ghh6T1lJJI6mY+RIV6YFKErjQD+CcdnwpHlyM/UntyhoHFO16o7g==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792424025;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:Message-ID:Date:From:To:Cc:Subject:In-Reply-To:References:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence;
	bh=40VX55JE7I8lotG+m4tWob4wIq5xuHTD0e55HnuCuwU=;
	b=nNb70rYwhGOcQarhuFEjFdS+zgcSxT2SP96SLYDHSVuHPJEi+tPyMjUq/L6bcKHS/IpO
	 aD1Yb6j6+8VZQWpAGDX+W67BYlxtlC4WHF184igtSRmWJH2uiCEN9WhBE/VJLnCNgauiQ
	 ssYI21CSEeAoc6wNJxUPraLu9o2YlbIMX3RpDDgPE1XViuU7QKfNfXLcHq5+ydCOoANL8
	 0zuM68L8UnBurLaiV2TzHHHap0j6A4LpCSfRIM4MpTFts33jcTyP0eFyXHYuWkGfdwKuC
	 vmh5FJAQ/ryK5cqRj9iHrza20l34jTYYLpNPbQusMVwlP52L0DrOTAsUSudaTQW2WIw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=MOHhUoaC;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.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 987DD6079D7B;
	Mon, 19 Oct 2026 15:33:45 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=MOHhUoaC
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.178
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1792424024;
	b=X5ldU9NrakEbG26FkkQOfYj4r6rVUzApxeec9jzbh9wNOOSnsW/xAmjTZMoshG2YRWTr
	 vhem7dj30R7aj6aauQ/WYnaGIY33VITxojFDfoduXoYiOZDHG8CJd4SGH1QDc/msGfkWp
	 FjEDFr2UhR44+2YLpQWnRVRn5WGGSPsJ4hdaNFOrrcZsQqmpnVv9LO+zrRXMnIfa4ZUFE
	 LmfEJA+LqA/z0Qt7HUqFajl4u1YZn2t5RjTi8YVC5WNFsZuaFAoMRbgl6Hlkir7wgqjMz
	 7oianKdyPM3RblKuvjeyrW2owrEBT05SGv1RY21V1gV70nfPJfwdNZG+JImeMLt11Vg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792424024;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Message-ID:Date:From:
	 To:Cc:Subject:In-Reply-To:References;
	bh=40VX55JE7I8lotG+m4tWob4wIq5xuHTD0e55HnuCuwU=;
	b=cJmoyc5rPVLkQoJJdJvyzCEeBG0fPHntJ0qOHtnWhNbIlT+/lxRwL9d12ccyoE/W48BP
	 wzZj4RddSg/bjPnFoaHLaQRjQVVMC46m80aIMRtDPjfc7QcKSNPDQME8pp2wtpWMAJPNm
	 0kOEVWwuc7ArH71YuqpZz/LtLSjGj/zDHj2ETdMSt9TpehYq0w+sY4cl+HbMhJJULWyFI
	 Ahxc+tT2rhxlJBzOiiTCeRfhhkTMxXGErxzGNoEXGKbr+wBmR5pnSEQEgOs6DG6GRWE71
	 WhQfv3P31sX518EhdOJeYF6w9++dHkElJZ59dQ/iIJXTos6S4ze1NRe6Tf2nr9Xhn2g==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=MOHhUoaC;
	arc=none smtp.remote-ip=74.125.82.178
X-Received: from mail-dy1-f178.google.com (mail-dy1-f178.google.com [74.125.82.178])
	(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 72891607887C
	for <netdev@vger.kernel.org>; Mon, 19 Oct 2026 15:33:44 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 72891607887C
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-dy1-f178.google.com with SMTP id 5a478bee46e88-360bd1d1f9bso242822eec.1
        for <netdev@vger.kernel.org>; Mon, 19 Oct 2026 08:33:44 -0700 (PDT)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1792424023; x=1793028823; darn=vger.kernel.org;
        h=references:in-reply-to:subject:cc:to:from:date:message-id:from:to
         :cc:subject:date:message-id:reply-to:content-type;
        bh=40VX55JE7I8lotG+m4tWob4wIq5xuHTD0e55HnuCuwU=;
        b=MOHhUoaCewBDcQI7j97alFtBVMoYrtatfUH0aiOZ78clFxr65xZZB5ortlDk3JbdmC
         W5zWvxKhOuyH3G3kVkl3Tjux8i3MCzCJyeE1s6+8cJKbl1So2HT3+3pkw96zaMEpSox5
         jny7r0NfuTAxxznYCurcAD3cIfEzQE4zfnz81Jlde0acBq6aXt/0zj1ERmA1MskQXEDp
         QQYDPioLlikUR6WRWoFX2fJRY9OX66ZWYm3KrVPRoMGdGGPA3HKUE43pN7coONk6im+c
         VNahbk4fHoaddaEzh91dK+8SL6nQW2c1ex0CRB0xqs24Ub1lyjNML9O/nEJLjzPUktA7
         nycQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1792424023; x=1793028823;
        h=references:in-reply-to:subject:cc:to:from:date:message-id:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=40VX55JE7I8lotG+m4tWob4wIq5xuHTD0e55HnuCuwU=;
        b=pqRAnNk5i3xHHJDfrhN20d43o3mHQfwukK0rHYBm0tQS6xag4w8acCBwh5xUu9zWwi
         3RtHMb+b2F383yEKCi7CSmeP6PrwrvUPnlRUoBubw5r2wybJgRFiycPymL7WmOT/b0mN
         gFpcPgCXEaWmhcZkmvvD1uo1eYJ4LIVRqyAy0gFydMo/IGZr6KyVXgxiT72tAIL4E/eZ
         F6p4w2IGLk/u2C/9r4EXXrdTDX4lIJO6XOroiQIpRzdJlt+cPPHTiihSMp3m6AnnIUrl
         KD7LhjAzW9wmIxJcM0dWDrHnPg8FNwzPthyoe9i87EYQ0iNN45PkKjShg7nQVOno2YPc
         evdg==
X-Gm-Message-State: AFq9FYKsWHo6JF1/hRYQc56uCzSCWtfm9IXSF+MD+X73LM9yS5KdlYzh
	09H/DcIBr1iNENJRgWIVw/RASpnLTCrkQDheBPX7/9PRULPiFYKkbOWo
X-Gm-Gg: AYBFou1IQ7stOrKExUtnPz5DNEgk5hA8dWfTciXHJbbqtJJQN5nRHRgF9qozAUSSFEp
	lO532lFLmtZGwfItPZSuy8lelawmg4KaUotfeN/Ykjkx1ZycXGa4IWwEqsypWFcd2afQkAZL4iq
	wQlYQNyEMCuM7rjRVFghzwRaBrJt9aGkyhcCr5eRYg6EQa7z1At/7sioinlr4YAcL66JNMAXQLP
	RUlSr+YkTSq3VCDbKjoXRtfcl/L1/Fl+Uzl+ln0J4qFdnkWpfnC64J25L7bDhnfzi6INQjX0VBF
	/Bhe+Zy9kcsr5XgeI5vm2dJhx/zKSuKO6hrM9bX4vTLvZ8ASQJWqeaNy2KCHSRDmugGT1tHi3ps
	I68u2aSghpltmElyRFeuneqUwwdtiUne32d3xS4vHcZ3Yj1Vdt4lt7psNkdncTWse92VTanv7Gq
	J+dSWWDf66F485eT+9OdPN7ODWttW/mdC54+WxWw24K4KAUze6u6YRWmcABiMQTLoV20cNsab3x
	c0kN82iXtrn9ehzUuGFEI9LQ/4h9JpZrgAzk5ysRJsXmuTbA/Y=
X-Received: by 2002:a05:693c:65cc:b0:35e:9cb2:b88a with SMTP id 5a478bee46e88-361a136a601mr17263822eec.2.1792424023344;
        Mon, 19 Oct 2026 08:33:43 -0700 (PDT)
X-Received: from msg ([188.253.120.76])
        by smtp.gmail.com with ESMTPSA id 5a478bee46e88-360813b684dsm33067697eec.10.2026.10.19.08.33.36
        (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256);
        Mon, 19 Oct 2026 08:33:42 -0700 (PDT)
X-Cc: steffen.klassert@secunet.com,
    Christian Hopps <chopps@labn.net>,
    Herbert Xu <herbert@gondor.apana.org.au>,
    "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>,
    David Ahern <dsahern@kernel.org>,
    Ido Schimmel <idosch@nvidia.com>,
    linux-kernel@vger.kernel.org
X-In-Reply-To: <20261018090638.55686-3-q.h.hack.winter@gmail.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