mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Eric Biggers <ebiggers@kernel.org>
Cc: Hannes Reinecke <hare@suse.de>,
	David Howells <dhowells@redhat.com>,
	bpf@vger.kernel.org, dm-devel@lists.linux.dev,
	fsverity@lists.linux.dev, keyrings@vger.kernel.org,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	Alasdair Kergon <agk@redhat.com>,
	Alexei Starovoitov <ast@kernel.org>, Alex Shi <alexs@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Andrii Nakryiko <andrii@kernel.org>,
	Benjamin Marzinski <bmarzins@redhat.com>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Dongliang Mu <dzm91@hust.edu.cn>,
	Eduard Zingerman <eddyz87@gmail.com>,
	Emil Tsalapatis <emil@etsalapatis.com>,
	Ihor Solodrai <ihor.solodrai@linux.dev>,
	James Morris <jmorris@namei.org>, Jiri Olsa <jolsa@kernel.org>,
	Jonathan Corbet <corbet@lwn.net>,
	Kumar Kartikeya Dwivedi <memxor@gmail.com>,
	Martin KaFai Lau <martin.lau@linux.dev>,
	Mike Snitzer <snitzer@kernel.org>,
	Mikulas Patocka <mpatocka@redhat.com>,
	Paul Moore <paul@paul-moore.com>,
	Randy Dunlap <rdunlap@infradead.org>,
	"Serge E. Hallyn" <serge@hallyn.com>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Song Liu <song@kernel.org>, "Theodore Y. Ts'o" <tytso@mit.edu>,
	Yanteng Si <si.yanteng@linux.dev>,
	Yonghong Song <yonghong.song@linux.dev>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH v5 2/3] KEYS: Replace assoc_array with rhashtable
Date: Fri, 6 Nov 2026 21:30:41 +0200	[thread overview]
Message-ID: <au4q4Wh7PK1-Ge9P@kernel.org> (raw)
In-Reply-To: <20261106191920.GA3383096@google.com>

On Fri, Nov 06, 2026 at 07:19:20PM +0000, Eric Biggers wrote:
> On Fri, Nov 06, 2026 at 09:05:15PM +0200, Jarkko Sakkinen wrote:
> > On Fri, Nov 06, 2026 at 02:02:11PM +0100, Hannes Reinecke wrote:
> > > On 11/6/26 10:05 AM, Eric Biggers wrote:
> > > > On Fri, Nov 06, 2026 at 09:21:32AM +0100, Hannes Reinecke wrote:
> > > > > While I am pretty much in favour with this approach, is there a specific
> > > > > reason why siphash has been chosen?
> > > > 
> > > > SipHash is the preferred choice for secure hash tables.  It is secure,
> > > > performs well on short inputs, and doesn't require special instructions.
> > > > See Documentation/security/siphash.rst
> > > > 
> > > > > Would there be a chance to make this configurable?
> > > > > I do see slight complications when running in secure environments
> > > > > (ie FIPS-certified environments) where most of the hash functions
> > > > > might not be available ...
> > > > 
> > > > SipHash support is available even when the kernel is booted with fips=1,
> > > > so there's no issue there.  It's already widely used in the kernel for
> > > > hash tables, and that hasn't blocked FIPS certifications either.
> > > > 
> > > Ah, right. Thanks for the information. Just wanted to cross-check here.
> > > 
> > > > Side note: fips=1 actually has little do with security, and in some
> > > > cases it actually decreases security.  See for example
> > > > https://lore.kernel.org/linux-crypto/20261026183332.11402-1-ebiggers@kernel.org/
> > > > where I'm fixing a vulnerability caused by fips=1.
> > > > 
> > > Oh, I am fully aware. FIPS is more a rubber-stamp than anything else.
> > > Unfortunately, a pretty powerful one.
> > 
> > Just representing this as an option but in the current mainline indices
> > are used instead of addresses, and thus it would be also an option to
> > just jhash across the board, if that part is retained (now it is being
> > removed).
> > 
> > On plus side, any security bugs in cryptography would not be a concern
> > of keyrings.
> 
> SipHash is also useful for resistance against denial-of-service attacks,
> where a user puts all their keys in one hash bucket.
> 
> As I mentioned, it's already used for secure hash tables elsewhere in
> the kernel.  That is what it's for; see
> Documentation/security/siphash.rst.  It's very fast as well, so if you
> are thinking of cryptography as being something very slow and hard to
> use, that is not what this is (or ever needed to be).
> 
> Let's just use it and not over-complicate things.

I'm pretty much non-opionated when it comes to this detail. I just
merely represent all the possible if anything comes up to mind. DoS
protection that you explained was not something I did even consider so
that seals it for me.

> 
> - Eric

Br, Jarkko

  reply	other threads:[~2026-11-06 19:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-05  3:13 [PATCH v5 0/3] " Jarkko Sakkinen
2026-11-05  3:13 ` [PATCH v5 1/3] KEYS: Introduce keyring_is_empty() Jarkko Sakkinen
2026-11-05  3:14 ` [PATCH v5 2/3] KEYS: Replace assoc_array with rhashtable Jarkko Sakkinen
2026-11-06  8:21   ` Hannes Reinecke
2026-11-06  9:05     ` Eric Biggers
2026-11-06 13:02       ` Hannes Reinecke
2026-11-06 19:05         ` Jarkko Sakkinen
2026-11-06 19:19           ` Eric Biggers
2026-11-06 19:30             ` Jarkko Sakkinen [this message]
2026-11-06 19:41               ` Jarkko Sakkinen
2026-11-06 15:08     ` Jarkko Sakkinen
2026-11-05  3:14 ` [PATCH v5 3/3] lib: Remove assoc_array Jarkko Sakkinen

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=au4q4Wh7PK1-Ge9P@kernel.org \
    --to=jarkko@kernel.org \
    --cc=agk@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexs@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bmarzins@redhat.com \
    --cc=bpf@vger.kernel.org \
    --cc=corbet@lwn.net \
    --cc=daniel@iogearbox.net \
    --cc=dhowells@redhat.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=dzm91@hust.edu.cn \
    --cc=ebiggers@kernel.org \
    --cc=eddyz87@gmail.com \
    --cc=emil@etsalapatis.com \
    --cc=fsverity@lists.linux.dev \
    --cc=hare@suse.de \
    --cc=ihor.solodrai@linux.dev \
    --cc=jmorris@namei.org \
    --cc=jolsa@kernel.org \
    --cc=keyrings@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=memxor@gmail.com \
    --cc=mpatocka@redhat.com \
    --cc=paul@paul-moore.com \
    --cc=rdunlap@infradead.org \
    --cc=serge@hallyn.com \
    --cc=si.yanteng@linux.dev \
    --cc=skhan@linuxfoundation.org \
    --cc=snitzer@kernel.org \
    --cc=song@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    --cc=yonghong.song@linux.dev \
    /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

all inboxes | Powered by JetHome®