netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Kicinski <kuba@kernel.org>
To: Willem de Bruijn <willemb@google.com>
Cc: Florian Westphal <fw@strlen.de>,
	davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
	pabeni@redhat.com
Subject: Re: [RFC] net: skbuff: let struct skb_ext live inside the head
Date: Wed, 15 Feb 2023 10:10:34 -0800	[thread overview]
Message-ID: <20230215101034.2c3cd1d6@kernel.org> (raw)
In-Reply-To: <CA+FuTSfjCvMAD9hf1JGOrSa57NZQ01n01-up3DF_bsf52N9MJw@mail.gmail.com>

On Wed, 15 Feb 2023 09:37:09 -0500 Willem de Bruijn wrote:
> How much data does psp need? The google version [1] embeds structs
> psp_skb, which may include a 256b key. If on tx the key is looked up
> from skb->sk, then on rx the only truly required field is the 32-bit
> SPI, to match a decrypted packet's session key to the socket. With a
> pointer hack on the lowest bits of skb->extensions such a tiny
> extension could perhaps be embedded in the pointer field itself.
> 
> https://github.com/google/psp/blob/linux-v5.15-psp-v1.0/include/net/psp_defs.h

So.. the most I could compress it to without sacrificing any security
was:

struct psp_skb_ext {
	u32 spi;
	u16 generation;
	u8 version;
};

I took the liberty to cut the generation down to 16 bits. The version
is not necessary if we assume all machines and flow run a single
version. But then why is the auth-only version even in the spec :(

In any case, you're right that this would fit into the pointer with
minor clever encoding. It felt even more hacky than extending shinfo
TBH.

I'd be curious to hear other opinions!

  reply	other threads:[~2023-02-15 18:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-15  3:44 [RFC] net: skbuff: let struct skb_ext live inside the head Jakub Kicinski
2023-02-15  8:53 ` Paolo Abeni
2023-02-15 17:58   ` Jakub Kicinski
2023-02-15  9:43 ` Florian Westphal
2023-02-15 14:37   ` Willem de Bruijn
2023-02-15 18:10     ` Jakub Kicinski [this message]
2023-02-15 18:13   ` Jakub Kicinski
2023-02-16 13:28     ` Florian Westphal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230215101034.2c3cd1d6@kernel.org \
    --to=kuba@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fw@strlen.de \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemb@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).