All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Sakkinen <jarkko@kernel.org>
To: Kyle Zeng <kylebot@openai.com>
Cc: keyrings@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org, dhowells@redhat.com
Subject: Re: [PATCH v2] keys: make keyring indexes independent of kernel addresses
Date: Wed, 14 Oct 2026 15:43:02 +0300	[thread overview]
Message-ID: <as941m0HXNruztLc@kernel.org> (raw)
In-Reply-To: <20261013231251.56170-1-kylebot@openai.com>

On Tue, Oct 13, 2026 at 04:12:51PM -0700, Kyle Zeng wrote:
> KEYCTL_READ returns the serial numbers in a keyring in associative-array
> traversal order.  The first word of the index is a public, deterministic
> hash of the type pointer, domain pointer and description.  An unprivileged
> user can therefore insert keys with known descriptions, predict their
> order for each possible KASLR slide, and recover the kernel image address.
> On an x86-64 build with 16 MiB alignment, 45 user keys suffice to
> distinguish the candidate slides.
> 
> Remove the addresses from the whole index, not just its first hash word.
> Assign each key type and domain a nonzero 64-bit ID and hash those IDs and
> the description with a once-initialized SipHash key.  Use the full IDs in
> the later index chunks as well.  Truncating or hashing the IDs there would
> lose the guarantee that distinct type/domain/description tuples have a
> differing index bit.
> 
> Allocate IDs lazily since private key types need not be registered.  Cache
> them in the index key so tree walks and copies of an existing index do not
> need to dereference a type descriptor that may have been unregistered.
> Keep the 32-bit chunk layout and diff_objects() bit offsets consistent,
> and retain the separate root slot for keyrings used by recursive search.
> The key comparison, permissions and userspace data format are unchanged;
> only the address-dependent in-memory ordering is replaced.
> 
> Fixes: b2a4df200d57 ("KEYS: Expand the capacity of a keyring")
> Assisted-by: Codex:gpt-6-astra
> Signed-off-by: Kyle Zeng <kylebot@openai.com>


Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>

I'll apply this.

And thanks for addressing that and sorry for nitpicking. Looks good to
me and thanks for addressing the bug. This is kind of AI assisted commit
to works for me; and I believe that checks are balances are in place.

Not everyone gets this, and the problem is that they also in effect
reduce the number of point of failures from two to one due
ignorance-by-a-choice.

A person submitting an AI-assisted patch is also a reviewer, and
ignoring this increases the probability of bad getting into mainline
quite literally.

I think some people might not really understand this at all but is
just that it is much less likely that two people get a patch wrong
and at the same time, than just one. That's it ;-)

This is not an AI/LLM problem. It is a misconduct by people quite
well scoped really...

Sorry for the rant just wanted to write this down and get this out
of my chest. Absolutely nothing to do with this patch.

Br, Jarkko

  parent reply	other threads:[~2026-10-14 12:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-13 23:12 [PATCH v2] keys: make keyring indexes independent of kernel addresses Kyle Zeng
2026-10-13 23:27 ` sashiko-bot
2026-10-14 12:43 ` Jarkko Sakkinen [this message]
2026-10-14 16:11   ` 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=as941m0HXNruztLc@kernel.org \
    --to=jarkko@kernel.org \
    --cc=dhowells@redhat.com \
    --cc=keyrings@vger.kernel.org \
    --cc=kylebot@openai.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.