🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #14655

Re: [PATCH net-next v1 04/15] psp: add support for socket-less psp associations

#14655
From: "Daniel Zahka"
Date: Wed, 11 Nov 2026 19:01
71 lines
14712 bytes
On Wed Nov 11, 2026 at 1:23 PM EST, Todd Bert Freed wrote:
>> I'm not sure the kernel actually needs any bookkeeping at all for these
>> generic rx spi allocations. You could probably just pass the spi, dev
>> id, key, and probably rotation count (as a device key generation of
>> sorts) to the user without creating a kernel object. For socket
>> psp_assocs, the rx state is consulted on the datapath before queueing to
>> the socket. For tx state in all psp_assocs, there is the possibility
>> that an SADB handle needs to be cleaned up. Neither of those apply here
>> or in the rest of the series as I understand it.
>>
>> I figure the tc ingress rule can just take the spi and dev id by value
>> rather than needing a reference to an object that we create here.
>
> That is how it works in this series. The tc psp decap rule (ingress) does not
> make reference to an rx assoc ; instead, it should have flower matches on
> psp_spi, psp_ver, and psp_dev. That effectively ties it to packets from just
> one rx assoc.
>
> So why keep track of rx assoc objects at all? Two considerations.
>
> 1/ don't accept packets that correspond to a stale association. That is, even
> if the device decrypted the packet, it should be dropped if the device key
> which minted the assoc's SPI is two rotations behind. For psp socket offload
> that is enforced in __psp_sk_rx_policy_check() with the pas->generation
> check.
>

I asked why we needed to keep track of socketless rx assoc objects. The
above applies to the existing transport mode code, which is my point.
The rx state from the assoc is looked up from the datapath. It doesn't
seem like that is the case in this series.

> The spec permits SPIs to be reused immediately after two rotations. So the
> device could decrypt a packet with a SPI that is more than two rotations old
> in that case, or if a previous packet is being replayed, for example.
>

A SPI that is two generations old will cause and auth error on rx. The
hazard is that an old tc rule with a SPI from two generations ago can
alias a different SPI from this generation. Userspace can just flush old
rules before doing a key rotation. That is why I suggested including a
'rotations' attribute, although that is probably not even necessary to
keep track of which rules need to be flushed.

> 2/ hardware offload. the solution to #1 should be able to be fully offloaded
> to the device. psp tunnel mode will be hw offload only, and is implemented
> in the eswitch with connect-x.
>
> We could add a psp_gen flower match to replicate the pas->generation
> check, but the device has no access to the pas and can't offload that.
>
> Keeping track of the rx assoc means that the kernel can take action on the
> "this assoc is now stale" event. Possibly by enumerating the tc rules and
> either deleting them, or marking them stale for userspace to reap.
>

I think it makes more sense for userspace to just get rid of the rules
before rotating the keys. 

> -Todd
Technical Details
Message-ID: <DMSM3RNRY412.1GXB07F4KGJYR@gmail.com>
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361228-linux-kernel-netdev=dewy.ru
References: <20261111005533.6436-1-toddfreed@meta.com> <20261111005533.6436-5-toddfreed@meta.com> <DMSJB8MZZCXK.MCEBRZQDAM5Q@gmail.com> <CADh2yMx8MPjcH7Bpj72rNNd_tT=6uSC5Ow9JyGjTMjFgs499Pw@mail.gmail.com>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!nntp.comgw.net!eternal-september.org!feeder.eternal-september.org!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-361228-linux-kernel-netdev=dewy.ru
From: daniel.zahka@gmail.com ("Daniel Zahka")
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next v1 04/15] psp: add support for socket-less psp
 associations
Date: Wed, 11 Nov 2026 14:01:14 -0500
Organization: Usenet Network
Message-ID: <DMSM3RNRY412.1GXB07F4KGJYR@gmail.com>
References: <20261111005533.6436-1-toddfreed@meta.com>
 <20261111005533.6436-5-toddfreed@meta.com>
 <DMSJB8MZZCXK.MCEBRZQDAM5Q@gmail.com>
 <CADh2yMx8MPjcH7Bpj72rNNd_tT=6uSC5Ow9JyGjTMjFgs499Pw@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="917719"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:sCS1gGZlFkP260lWvCBK9LeHnv0= sha256:b9nraV/ASF8eceOg31ZeX/3LnD20ajjh6tzL7U6p+pM=
	sha1:sO084V9Ndqoet76f1HzzpuXLnPk= sha256:I6bOve3Ajn+G+stFOAmHCCLzlmNXK5OyZwrkuBrTruI=
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 70045113F91; Wed, 11 Nov 2026 22:01:59 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.149
X-Spam-Status: No, score=-3.149 tagged_above=-9999 required=6.31
	tests=[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.249, 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 Xr0hrxIXUU0l;
	Wed, 11 Nov 2026 22:01:52 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.232.135.74; helo=sto.lore.kernel.org; envelope-from=netdev+bounces-361228-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 sto.lore.kernel.org (sto.lore.kernel.org [172.232.135.74])
	by mail.dewy.ru (Postfix) with ESMTPS id 3A4F3113F63; Wed, 11 Nov 2026 22:01:41 +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 133A661518D; Wed, 11 Nov 2026 19:01:26 +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=1794423679;
	b=Li8Eysb/u4timjxPJQhlEz41VHypL5G8wbgkWbazMI6S883YeDJKBHd7c2avFyHRz95w
	 RtWdM0xbolamCdl+YqG4VajTlYVu28pz5ec8PZLQ3PLLCY/p/u/Wdwm3SYHdji1gV8JOX
	 x6BLstfZ7FI00B3MosVcpRvlKrcXrAIz46vF48igzOhQwjTDxEteBxQAPlOcxl03D6PHP
	 snpP95a582uutc1PjFbopPXEA6QciDRbVPXnJG7O8kIj6WXZ8ivdbNA5Cp4S4GicLHO18
	 gjrAzN9pSPFhH5JDhXliC5fUjJcn0ws4qrFd41PARNrbcmRk/Jg2I9Qgd/Ch/E5GqKA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794423679;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 Received:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:Mime-Version:
	 Content-Transfer-Encoding:Content-Type:Date:Message-Id:Cc:Subject:
	 From:To:X-Mailer:References:In-Reply-To;
	bh=3mcdsvysa9luSuezEbeTLmuh15u7mjwAepQLZ7oOKD4=;
	b=UJ6/+wN4//b2RgTbnVbKppBaUYVqDIdSsPurfYVFvTfL2kLYwb3Whnkfk/GeMnsFrx5S
	 dENq0xyRbfM6O8wAo3LEWqOvSRiGBxQyvqhGN49jaOnCgJ2Izl2p7DQmdkERJTg+KAuZD
	 56aDwBoAXoBxeuM8tX/vvdQQ/Ea/nHU9y8KMjFiaJ8kgTVHHfMpkuR0aOBO+RCjfWaeXI
	 CSWv3IC1Efnar2Kbj2mNu/KoTj+N8LHLxdAWt8az15ut4+h4J8l3JeteHMiIHk0jCU6IA
	 9PMsZcGsYauRMeKOjNeHsF5xhrW7AvLxMGlh8HQG5EH507wdZ7hV0wNY2HVPCpXgCdw==
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=20260707 header.b=LHkRigWs;
	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 70849606A881;
	Wed, 11 Nov 2026 19:01:19 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=LHkRigWs
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.222.171
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1794423678;
	b=s5gOJhBt497IYP4Z+5WbAlD6pp3rWoQqUPHJasfAPnkv8iGLj2IrsrsKHr02LK3bQx9C
	 S4xfCjO/DsGke3CFtGsPuuMTNxkNkjwD7oFfl0YaL2qlrFY+iAFIlwlybUIKyotm792yk
	 uNFMZEEg7pZ0hJWdRfVG/jIy3phYt2nHR+p76pmHj89i87Mk/LJ+k9NRO6Oq13l1D6Cx0
	 +Ta0FlBzZSAeRwcx8sm4r1Npe0OQNHjqsSpApwk4AZVKPq0y/cuNlA8I3SbnfydbYfYOz
	 w/So/A45CprQ3GiqQNby9+9ZgpP6cJJx7NenIkIWljnhs52PCZ3jRKDUljx8iXS2ZfA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1794423678;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Mime-Version:
	 Content-Transfer-Encoding:Content-Type:Date:Message-Id:Cc:Subject:
	 From:To:X-Mailer:References:In-Reply-To;
	bh=3mcdsvysa9luSuezEbeTLmuh15u7mjwAepQLZ7oOKD4=;
	b=AUSi2yyjsr5IPUw9eg3ZfuVd2Hal4nukoXGxsaxEJhDnvT+HhjMLv1sL2UsS0GpbdTGr
	 /TkSyY/EHoU8VBsnU24wKuj/WCUhJTkB5+zydybHliFjdR9eqFTSFKDn9pk3vcs1+2u5W
	 Cj6+KFCnvtl6/hCfbQtwGK7oXY7u9r8by5/hULDTEm1Bfhh6UiiPEGo4IauCAqFFZw1SD
	 CCMFngHgoYEdav7ZBDw+7DW+ko6WEFpQ816dgv7RlpP3ZezgMa4a7+AjqglMQK74W7gGB
	 p7MC7mB/0R3ngx0yy2lmBMWohcYNHWcsDXlktdFbGYf12Vsfxit6fcdPuYwdBWOUooQ==
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=20260707 header.b=LHkRigWs;
	arc=none smtp.remote-ip=209.85.222.171
X-Received: from mail-qk1-f171.google.com (mail-qk1-f171.google.com [209.85.222.171])
	(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 423C5606A327
	for <netdev@vger.kernel.org>; Wed, 11 Nov 2026 19:01:18 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 423C5606A327
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-qk1-f171.google.com with SMTP id af79cd13be357-93e63ee7b4cso315172885a.2
        for <netdev@vger.kernel.org>; Wed, 11 Nov 2026 11:01:18 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20260707; t=1794423677; x=1795028477; darn=vger.kernel.org;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-type:content-transfer-encoding:mime-version:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=3mcdsvysa9luSuezEbeTLmuh15u7mjwAepQLZ7oOKD4=;
        b=LHkRigWscoO1IXIQFs6/S7w1FUhRnu66lP+me1F9tp+woQK1t61v4UNNSyggqb4mOX
         hkOb5/IVXmfs4ZveeHLDMgbH2NVuzIEY/J/WPy/shFxDKAiXJz6IbXyPUV4ckFZ+CsC+
         c9gkmXH6qx8NuT+7knfat6nN41LKdJI5AqHmXOuhg18s+O76DdTa+1UL8roEbcvId/Ns
         kTG/VWDpa7xwT+xoPmwPqh3uf6iTwuE9zBLajqn7CgcAuA/eMNIzXPPLnoO373jqfflo
         BWXGJsKWiNERilvEBM6NM78A4lF9eT8HO6VECVYKCKap11URDX6Ewiu7J/Bp2B4VyeQc
         r7RQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1794423677; x=1795028477;
        h=in-reply-to:references:to:from:subject:cc:message-id:date
         :content-type:content-transfer-encoding:mime-version:x-gm-gg
         :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=3mcdsvysa9luSuezEbeTLmuh15u7mjwAepQLZ7oOKD4=;
        b=hUBOXgmFN/sepc3tcc/b3Sca+31MCYCBMnvzo+Xoe4XcvCeW4JYC4+7n86dxbV+hiW
         zsb9pqU/3dm69/UUqhm9kx22IqDIbBdEV3RjJylfpxgWPW5Cluf+CPPYCffj++ewIf4y
         DNuKmqdV1W1XGryZVnaImnthgn21BDyhrrOMJ3NAdVqwd/FPe5vZkX2Dedd3ZZgZAy/2
         EizlMjr9uJhJA5c8x7XEkRDPxyghAaR9e5SBp3v6Kd5/R9WfZ4r6HPh7ZjhLbpLBz8Ih
         MAusE3LRKCyFSzOr+zfyIf0MMDK6Kqk/TJ1edMe1Msg22QCALzQLxZLyMabVmkjldkru
         NOYg==
X-Gm-Message-State: APuU4Z+VZlh80lnhYmiIOwVOESFti56yiXkzn3NfML61wzGMKrfxwP8U
	HJHdUbqqYUSFcwXm3uG2nD29Hwjov2pJ2/PG66KecBzAAnOy6NjCn1Ew
X-Gm-Gg: AYBFou29X4UjKsSksyX8wlfRjtSOBbijRcKjyhqUadfnXBWT/unH7S5FFLpgqxMhxzB
	ahuFr2bF0G9Z6hywtLJ3S4MNHVHlqfhyaYkFAZ2RF7WnUISceR56a1DwbIwOTzt98Lqbqns8GGa
	NsupwITrcJWiok4ZJfzkwbj8GOC6DOyEYrF17FoJOR1F0to9+us7WlgmfsjUB0qM4Z6oAl2C5ql
	DY0IFrsGWgO01E2ZaOY9EhAVT4F15D4c590rZdBq08yZvokufArjl8ioIeNq8XcFVj1pgsHOWN7
	ShXSAvyq6f9pgXFGf9PfR8t8LXr10f41u9mak7jN8VRKjzDO4yTY6ZlPD0U7UjXwNZ/ChtNFksy
	Atp933U+JRGH3Uaun/QDD0noWd5E+m3buMyIDMW0gRQ6VoFjjXvf98SzMmO6HpCN2LDH7sp2LlP
	vxjXglyOjhk+CMvgiHjJBlqevjighvwmaV6n3dZRJg2xM0U3HuhHDWq5G3LIMOxGzt5WFq7UpN+
	Csx90F/XkhBCwT8IeOdJEy+oyeMfJn7wws4Rc4lqAc48L+3yusQJnq7V623HuqUf838yJL7s5bE
	BC7l4knGt9hlzISYR1rVMm1jVzMJdWixiL5S1aiWRzlw1YnDelQeZyU=
X-Received: by 2002:a05:620a:2b96:b0:93f:53d1:54c7 with SMTP id af79cd13be357-947b00d141dmr521152085a.70.1794423676923;
        Wed, 11 Nov 2026 11:01:16 -0800 (PST)
X-Received: from localhost ([2600:4040:9399:4000:e553:72e5:7d37:c7ef])
        by smtp.gmail.com with ESMTPSA id af79cd13be357-9479e73b2d2sm545314185a.10.2026.11.11.11.01.14
        (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
        Wed, 11 Nov 2026 11:01:15 -0800 (PST)
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-Cc: <netdev@vger.kernel.org>, "David S. Miller" <davem@davemloft.net>,
 "Andrew Lunn" <andrew+netdev@lunn.ch>, Björn Töpel
 <bjorn@kernel.org>, <bpf@vger.kernel.org>, "Daniel Borkmann"
 <daniel@iogearbox.net>, "Donald Hunter" <donald.hunter@gmail.com>, "Eric
 Dumazet" <edumazet@kernel.org>, "Jakub Kicinski" <kuba@kernel.org>, "Jamal
 Hadi Salim" <jhs@mojatatu.com>, "Jiri Pirko" <jiri@resnulli.us>, "John
 Fastabend" <john.fastabend@gmail.com>, <linux-doc@vger.kernel.org>,
 <linux-kernel@vger.kernel.org>, <linux-kselftest@vger.kernel.org>,
 <linux-rdma@vger.kernel.org>, "Martin KaFai Lau" <martin.lau@linux.dev>,
 "Paolo Abeni" <pabeni@redhat.com>, "Saeed Mahameed" <saeedm@nvidia.com>,
 "Simon Horman" <horms@kernel.org>, "Tariq Toukan" <tariqt@nvidia.com>, "Wei
 Wang" <weiwan@google.com>, "Willem de Bruijn"
 <willemdebruijn.kernel@gmail.com>
X-Mailer: aerc 0.21.0-threadmapfix
X-In-Reply-To: <CADh2yMx8MPjcH7Bpj72rNNd_tT=6uSC5Ow9JyGjTMjFgs499Pw@mail.gmail.com>