From: Kyle Zeng <kylebot@openai.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
David Howells <dhowells@redhat.com>
Subject: Re: [PATCH] assoc_array: Preserve full words when splitting shortcuts
Date: Tue, 6 Oct 2026 15:33:53 -0700 [thread overview]
Message-ID: <asV3UaPsA2xSz8Cc@com-75606> (raw)
In-Reply-To: <20261006152508.ba7f3c7a6661daed4767a18a@linux-foundation.org>
On Tue, Oct 06, 2026 at 03:25:08PM -0700, Andrew Morton wrote:
> On Tue, 6 Oct 2026 15:06:38 -0700 Kyle Zeng <kylebot@openai.com> wrote:
>
> > assoc_array_insert_mid_shortcut() copies enough index-key words for the
> > new pre-shortcut, then masks off the unused bits in its last word. If
> > diff is word-aligned, the shift is zero and the mask clears that entire
> > word, even though all of it belongs to the required prefix. The new
> > shortcut no longer matches the objects behind it, so lookups can fail
> > for both the existing objects and the new one.
> >
> > For example, inserting a user key with a different description length
> > into a keyring containing enough full-hash collisions can split a
> > shortcut at bit 64 and erase its hash word. The resulting search
> > failure can also expose the pointer-dependent keyring hash as a KASLR
> > oracle.
> >
> > Only trim the last word when diff ends inside it. This mirrors
> > commit bb2ba2d75a2d ("assoc_array: Fix shortcut creation"), which fixed
> > the terminal-node case, and leaves non-word-aligned splits unchanged.
>
> Thanks.
>
> When fixing a bug please clearly describe the userspace-visible runtime
> effects of that bug. Including how-to-hit-it, reproducer, user reports, etc.
Hi Andrew,
Thanks for the response.
As mentioned in the commit message, a search failure can expose the
pointer-dependent keyring hash as a KASLR oracle. As a result, a local
unprivileged user can use this to leak kernel pointer and bypass KASLR.
The reproducer is not attached intentionally but can be shared through
DM.
Best,
Kyle
>
> > Fixes: 3cb989501c26 ("Add a generic associative array implementation.")
> > Cc: stable@vger.kernel.org
>
> Especially when proposing a backport.
> Documentation/process/stable-kernel-rules.rst provides guidelines.
>
> > Assisted-by: Codex:gpt-6-astra
> > Signed-off-by: Kyle Zeng <kylebot@openai.com>
> > ---
> > lib/assoc_array.c | 8 +++++---
>
> get_maintainer coverage is poor. Please use git-show also:
> hp2:/usr/src/mm> git show -s --format="%an <%ae> - %s" 3cb989501c26
> David Howells <dhowells@redhat.com> - Add a generic associative array implementation.
>
> Also, as this affects keyrings, grep -i keyrings MAINTAINERS shows the
> mailing list.
next prev parent reply other threads:[~2026-10-06 22:33 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-06 22:06 Kyle Zeng
2026-10-06 22:25 ` Andrew Morton
2026-10-06 22:33 ` Kyle Zeng [this message]
2026-10-06 22:42 ` Andrew Morton
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=asV3UaPsA2xSz8Cc@com-75606 \
--to=kylebot@openai.com \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@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 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®