From: Greg KH <gregkh@linuxfoundation.org>
To: Pimyn Girgis <pimyn@google.com>
Cc: stable@vger.kernel.org, Alexander Potapenko <glider@google.com>,
Dmitry Vyukov <dvyukov@google.com>,
Marco Elver <elver@google.com>,
Ernesto Martnez Garca <ernesto.martinezgarcia@tugraz.at>,
Kees Cook <kees@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 5.15.y v3] mm/kfence: randomize the freelist on initialization
Date: Thu, 5 Feb 2026 16:32:29 +0100 [thread overview]
Message-ID: <2026020508-rabid-heaviness-d146@gregkh> (raw)
In-Reply-To: <20260205145055.3333340-1-pimyn@google.com>
On Thu, Feb 05, 2026 at 03:50:55PM +0100, Pimyn Girgis wrote:
> Randomize the KFENCE freelist during pool initialization to make
> allocation patterns less predictable. This is achieved by shuffling the
> order in which metadata objects are added to the freelist using
> get_random_u32_below().
>
> Additionally, ensure the error path correctly calculates the address range
> to be reset if initialization fails, as the address increment logic has
> been moved to a separate loop.
>
> Link: https://lkml.kernel.org/r/20260120161510.3289089-1-pimyn@google.com
> Fixes: 0ce20dd84089 ("mm: add Kernel Electric-Fence infrastructure")
> Signed-off-by: Pimyn Girgis <pimyn@google.com>
> Reviewed-by: Alexander Potapenko <glider@google.com>
> Cc: Dmitry Vyukov <dvyukov@google.com>
> Cc: Marco Elver <elver@google.com>
> Cc: Ernesto Martnez Garca <ernesto.martinezgarcia@tugraz.at>
> Cc: Greg KH <gregkh@linuxfoundation.org>
> Cc: Kees Cook <kees@kernel.org>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> (cherry picked from commit 870ff19251bf3910dda7a7245da826924045fedd)
> Signed-off-by: Pimyn Girgis <pimyn@google.com>
> ---
> v2: handle addr calculation for error path within appropriate loop
What changed in v3?
Yes, it's a nit, but please, we have a process :)
thanks,
greg k-h
next prev parent reply other threads:[~2026-02-05 15:32 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-03 12:48 FAILED: patch "[PATCH] mm/kfence: randomize the freelist on initialization" failed to apply to 5.15-stable tree gregkh
2026-02-04 12:56 ` [PATCH 5.15.y] mm/kfence: randomize the freelist on initialization Pimyn Girgis
2026-02-04 13:12 ` Greg KH
2026-02-05 9:53 ` [PATCH 5.15.y v2] " Pimyn Girgis
2026-02-05 14:11 ` Greg KH
2026-02-05 14:27 ` Pimyn Girgis
2026-02-05 14:30 ` Greg KH
2026-02-05 14:50 ` [PATCH 5.15.y v3] " Pimyn Girgis
2026-02-05 15:32 ` Greg KH [this message]
2026-02-05 16:33 ` [PATCH 5.15.y v4] " Pimyn Girgis
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=2026020508-rabid-heaviness-d146@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=akpm@linux-foundation.org \
--cc=dvyukov@google.com \
--cc=elver@google.com \
--cc=ernesto.martinezgarcia@tugraz.at \
--cc=glider@google.com \
--cc=kees@kernel.org \
--cc=pimyn@google.com \
--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