From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx1.secunet.com (mx1.secunet.com [62.96.220.36]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FD603A1E8C; Tue, 7 Apr 2026 08:18:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=62.96.220.36 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775549895; cv=none; b=nEZ3HawYR3/6gKvLr5Z+EA6/SL/pNcNMy5HrfzZjG01oPYI06J4rxV4pdmNlhqqFiwpQU51q5pCbLk5PxmVyXjbNOgEW22K1xO4ldgE+bdtk6cZ1W1JSuCFBtg6QRygi6YXBKQnRlWjYbL+dmi4slsysMFuYydfqCcM3WcEMCrM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775549895; c=relaxed/simple; bh=5ok4QkEk2ecZ9Neu7GfeMOLUeAH3HVo1IjxeCHN9w8w=; h=Date:From:To:CC:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Ej6ucQqm4lz5T4XVmXjYspdcQweSwfpr1rHuOql9dpbtUO+ml7rLCBvugNct/fdQs3IENBieWpWjAA10nh/l+56Lm/dwFCdDV3SV/giFAyHQJ+lSUUv6uSMRrbZKLNHnXPhtjHJqNhXb36mjHZPB4wsRX28dkqtrw94Datb4vxw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=secunet.com; spf=pass smtp.mailfrom=secunet.com; dkim=pass (2048-bit key) header.d=secunet.com header.i=@secunet.com header.b=MEUzOSdg; arc=none smtp.client-ip=62.96.220.36 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=secunet.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=secunet.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=secunet.com header.i=@secunet.com header.b="MEUzOSdg" Received: from localhost (localhost [127.0.0.1]) by mx1.secunet.com (Postfix) with ESMTP id BBF4520190; Tue, 7 Apr 2026 10:18:11 +0200 (CEST) X-Virus-Scanned: by secunet 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 roCMZOOL-IYI; Tue, 7 Apr 2026 10:18:10 +0200 (CEST) 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 8077C201E4; Tue, 7 Apr 2026 10:18:10 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.secunet.com 8077C201E4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secunet.com; s=202301; t=1775549890; bh=Vgb6F9weC/Io1CmZ6aEL4II+s0NRunH5mXdjMYJvlas=; h=Date:From:To:CC:Subject:References:In-Reply-To:From; b=MEUzOSdgo1HPgkvFtPhKE/K2cOxA/yJdyADf3ZZQskqg6cxXEUB/q68e1MN/zldge ckzltEx3F75lvRsVEcEkKlNqijh0CpQX2kWoghBJs6ogjsunwIwrnoG6dELIG2WsPl e+i63hxHiR06NeQWj3Tb1LkVPf5n1VNZYbRot87HKe+Yx8ruT9YezwSy0vm/9QR8Jp wOxcU5QhU/vLzFzHv4NqNMxTzpAWZWbzWkya6tUrHOUpMXq8ysVsN2MZNe7yddHZu6 ySzyYHX3+mUlbNybDFMomybjUG/tsBQ6wsRhjyVX+WXod6jsHVhRdcefuZNQbcF7hA rvlVW7goXPUFQ== Received: from secunet.com (10.182.7.193) 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.17; Tue, 7 Apr 2026 10:18:09 +0200 Received: (nullmailer pid 1490357 invoked by uid 1000); Tue, 07 Apr 2026 08:18:08 -0000 Date: Tue, 7 Apr 2026 10:18:08 +0200 From: Steffen Klassert To: Qi Tang CC: Herbert Xu , Florian Westphal , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Simon Horman , David Ahern , , Subject: Re: [PATCH v3] xfrm: hold dev ref until after transport_finish NF_HOOK Message-ID: References: <20260402114401.62212-1-tpluszz77@gmail.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20260402114401.62212-1-tpluszz77@gmail.com> X-ClientProxiedBy: EXCH-03.secunet.de (10.32.0.183) To EXCH-01.secunet.de (10.32.0.171) On Thu, Apr 02, 2026 at 07:44:01PM +0800, Qi Tang wrote: > After async crypto completes, xfrm_input_resume() calls dev_put() > immediately on re-entry before the skb reaches transport_finish. > The skb->dev pointer is then used inside NF_HOOK and its okfn, > which can race with device teardown. > > Remove the dev_put from the async resumption entry and instead > drop the reference after the NF_HOOK call in transport_finish, > using a saved device pointer since NF_HOOK may consume the skb. > This covers NF_DROP, NF_QUEUE and NF_STOLEN paths that skip > the okfn. > > For non-transport exits (decaps, gro, drop) and secondary > async return points, release the reference inline when > async is set. > > Suggested-by: Florian Westphal > Fixes: acf568ee859f ("xfrm: Reinject transport-mode packets through tasklet") > Cc: stable@vger.kernel.org > Signed-off-by: Qi Tang Applied to the ipsec tree, thanks a lot!