Article View: linux.kernel.netdev
Article #14447Re: [PATCH ipsec 0/2] xfrm: fix state lifetimes in xfrm_migrate()
From: Steffen Klassert
Date: Wed, 11 Nov 2026 09:09
Date: Wed, 11 Nov 2026 09:09
24 lines
10332 bytes
10332 bytes
On Sat, Oct 31, 2026 at 12:14:53PM +0800, Cen Zhang wrote: > xfrm_migrate() keeps the old states in x_cur[] and their successors in > x_new[], but it does not hold a reference to every state it later > deletes. An SA with a hard lifetime can expire and be freed by the timer > and the state GC in that window, and the following xfrm_state_delete() > takes the lock of freed memory: > > 1/2 The success path drops the lookup references of the old states > before it deletes them. Delete them first. > > 2/2 xfrm_state_migrate() returns the published successor without a > caller reference, so the rollback deletes states it does not > hold. Take that reference before publishing and drop it after the > migration commits or rolls back. > > Both windows date back to the initial migration support and are reached > by XFRM_MSG_MIGRATE and PF_KEY's SADB_X_MIGRATE. > > Cen Zhang (2): > xfrm: keep old state references until migration deletion completes > xfrm: hold migrated states through rollback Series applied, thanks a lot!
Technical Details
Message-ID:
<avQwzAEyN98FXtCP@gauss4>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360938-linux-kernel-netdev=dewy.ruReferences:
<pm-xfrm-core-objects-candidate-0027-v3-cb1e033bff1976f510c9-0@gmail.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-360938-linux-kernel-netdev=dewy.ru From: steffen.klassert@secunet.com (Steffen Klassert) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH ipsec 0/2] xfrm: fix state lifetimes in xfrm_migrate() Date: Wed, 11 Nov 2026 10:09:32 +0100 Organization: Usenet Network Message-ID: <avQwzAEyN98FXtCP@gauss4> References: <pm-xfrm-core-objects-candidate-0027-v3-cb1e033bff1976f510c9-0@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Injection-Info: usenet.network; logging-data="817123"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:Hryy+BUZh6pbRKc9y+fIGHpgjaM= sha256:xVtWb/sUSDCP9qe1ro89Xtcd5+KqNWG+qMlJi2Dko0A= sha1:PR1cPRH/1AeOpPkHeBvlKN93pmU= sha256:yJJbYstfk2S2wYzw239Snp6cXYvAT+QxXPJQEQwWBes= 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 C6DC7113E70; Wed, 11 Nov 2026 12:11:57 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.15 X-Spam-Status: No, score=-3.15 tagged_above=-9999 required=6.31 tests=[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 ZHVbsraaDvWH; Wed, 11 Nov 2026 12:11:54 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-360938-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74]) by mail.dewy.ru (Postfix) with ESMTPS id 85F33113E14; Wed, 11 Nov 2026 12:11:46 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sto.lore.kernel.org (Postfix) with ESMTP id 35790660321; Wed, 11 Nov 2026 09:09:46 +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=1794388182; b=Oqh/Hxpv6i323Xskem+qvMre0JbqRVSQijJiMfrYgn1RQ5Dc4/rth2evzuIq5LxqGjME a8/mxMmM6yJgQfHcwIgjObOCKpVKMsHTdwTjnZESLcMYlJGmr5aQAkxsgV418PcHFvnmj lV7/1JM/VmZvJZ0fIBsYcbbQx16KtE0ktL1cOAMugTdLbbk5gEheHzuMbPB3ARC+1XCXy VD4vkI8tN+TkZ1YbZKqP8s2Y+JdOCijvQCTxXnsSuvl8VtIOjyplKd5MFXfnrgP+DlDI8 d1uTvg8zAVc9R53fNiN8dHoxlSB9PR6JMoJlh5v237o7nkfk6bfQ6oPJ3id3WaYYGwQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794388182; 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=JMnF4PCYPlIbkJ1oxYQongigJralZxvOfmyUW19HLtY=; b=k89oaFW2R98ez/U4678J8zwv3BiU1F4TfvoHWnOJwlpO4ArP1SdLFWDMu8nM6Xrp9ICL Nn/WnMkqdEJSXP41bQF18lgyuVqZVTa14MoS+4IjTEhQFHOwonpVa5Ub4rEIUvfTysd/O 9zmWKlrDDUqtvOQktOMOZ0FxfWrRZC3TPgFdYJ0076s1kfYJSSebQGiJhdzCz3c5N+qgt 9stXamV31Y5cYZ1/mhYsc957ewZBiU5vOq/v4QlV8/rtdshORh26xaWL/G9PWsj/avFOj JaR91oyXMs+u+LmGeMu7XrZ630JjhPDtCIzo1lNuJbNAYReg2Ig8X5RdnG8/hbpKekA== 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=np6JyC4g; 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 B6AE7606A33B; Wed, 11 Nov 2026 09:09:42 +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=np6JyC4g 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=1794388181; b=ISaI+cvEl6glPQ2ryf3xlWFDXIeWcYlMd9WUeuXZA85wpO+ldMKKRZFobCtbhJQeb6zV B2TpKagp6tT21XCP8N52BAna34dkRfQMS4lyVLsIPGq+o2KYqp+lKWufi2zdO5qOT8L9A 6ltfqd8bcCT/0zGyGhiatqR3bYFrjJ3sYeNwd+hGYbStGDKC+ru6+V3TDqcufLlziiyV4 WPvxgD+wHage8DsmOZsfN5siNtBECj5UHbF9GRQQA7aKvQFfTPKJbe3afRt5lNAKgtfou 6mZl1ifHtbxQ8gBmEBQQaNB05jZyfMoNo3/5xs/eoKERW5tqon5/DqPv72yu+Wv5qdg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794388181; 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=JMnF4PCYPlIbkJ1oxYQongigJralZxvOfmyUW19HLtY=; b=X2qI11mTjjrSqe7cO2cMz2WEdcdvZyAbPWSJ7V2o4x6cu7Zfbpj9lob+aa/A7cepKhbM j8mmg+fdO5NGYhaDT/iFidlRK7QyG0QF3IBZfjHiwtRmSd3wUyMT2Cl2768OcAiDfwTtW AnO5LvVCnQcDHtJH8PuVCYSnFp3vDPYWlDzJLC1AYegd40M/tjyKEcXIwaOK2tqKeI8SS HKu6wUuvamhAg6bflUiDt75BzE6Sn6sBzYmrXnV8KXQ5Xj0zrj9aWAgvkKpsGp3jpw548 2FMmcBlMBkQ4tOdXRg8qcopUEVcK+zmdxjcj8EEflGqsQTzMIf81Di1KcSSoxDlY3Nw== 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=np6JyC4g; 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 ADA25606A334; Wed, 11 Nov 2026 09:09:40 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org ADA25606A334 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 9CDC3207B2; Wed, 11 Nov 2026 10:09:33 +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 dTmcJfnknn3b; Wed, 11 Nov 2026 10:09:33 +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 1C10C207AC; Wed, 11 Nov 2026 10:09:33 +0100 (CET) X-DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.secunet.com 1C10C207AC X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=secunet.com; s=202301; t=1794388173; bh=JMnF4PCYPlIbkJ1oxYQongigJralZxvOfmyUW19HLtY=; h=Date:From:To:CC:Subject:References:In-Reply-To:From; b=np6JyC4gwPXiK0leSmE7U1RXD9ZKRE240QTweBOZiiPZYx1K6ItrrKYFw5dKYZIWA lwTSXlE99t5EX2MY+FkqPtSsJ8gSGtpStj2VurRwRxZ3Rb8onABufuFiNnln1zZSdI wLemyMvB73//2nRZVYcl59zCHRW1WQQqskosuls9/Y/+38lmwhbxx6ftT1QKUCoCt9 rWhYho3U1asaMdU/XFoRLNpiCf1CPQHtz+R22XI30kPA9n7/HOHnJJwF+fMEPFSByI chsBTEhmWoz1M2n8gUkaQEUMlPnJs7iFJaF5r2f6yteOg0hlWkDDhjtjBzRQZrws8n ZGoYaOTr/1z3A== 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; Wed, 11 Nov 2026 10:09:32 +0100 X-Received: (nullmailer pid 1103798 invoked by uid 1000); Wed, 11 Nov 2026 09:09:32 -0000 X-CC: <herbert@gondor.apana.org.au>, <davem@davemloft.net>, <edumazet@google.com>, <kuba@kernel.org>, <pabeni@redhat.com>, <horms@kernel.org>, <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <baijiaju1990@gmail.com>, <jjzuming@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 X-In-Reply-To: <pm-xfrm-core-objects-candidate-0027-v3-cb1e033bff1976f510c9-0@gmail.com> X-ClientProxiedBy: EXCH-01.secunet.de (10.32.0.171) To EXCH-01.secunet.de (10.32.0.171)