linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: david.keisarschm@mail.huji.ac.il, linux-kernel@vger.kernel.org
Cc: Jason@zx2c4.com, linux-mm@kvack.org, akpm@linux-foundation.org,
	42.hyeyoo@gmail.com, mingo@redhat.com, hpa@zytor.com,
	keescook@chromium.org, ilay.bahat1@gmail.com,
	aksecurity@gmail.com
Subject: Re: [PATCH v6 0/3] Replace invocations of prandom_u32() with get_random_u32() and siphash
Date: Mon, 17 Apr 2023 17:26:41 +0200	[thread overview]
Message-ID: <20e3bfd8-851e-1e2a-76b5-7c705e4d1c3d@suse.cz> (raw)
In-Reply-To: <20230416172158.13133-1-david.keisarschm@mail.huji.ac.il>

On 4/16/23 19:21, david.keisarschm@mail.huji.ac.il wrote:
> From: David Keisar Schmidt <david.keisarschm@mail.huji.ac.il>

Hi,

btw, the threading of v5 and v6 seems broken, v4 was fine.

I've added the patches 1+2 to slab tree for 6.5 (too late for 6.4 now):

https://git.kernel.org/pub/scm/linux/kernel/git/vbabka/slab.git/log/?h=slab/for-6.5/prandom

Thanks,
Vlastimil

> Hi,
> 
> The security improvements for prandom_u32 done in commits c51f8f88d705
> from October 2020 and d4150779e60f from May 2022 didn't handle the cases
> when prandom_bytes_state() and prandom_u32_state() are used.
> 
> Specifically, this weak randomization takes place in three cases:
>     1.	mm/slab.c
>     2.	mm/slab_common.c
>     3.	arch/x86/mm/kaslr.c
> 
> The first two invocations (mm/slab.c, mm/slab_common.c) are used to create
> randomization in the slab allocator freelists.
> This is done to make sure attackers can’t obtain information on the heap state.
> 
> The last invocation, inside arch/x86/mm/kaslr.c,
> randomizes the virtual address space of kernel memory regions.
> Hence, we have added the necessary changes to make those randomizations stronger,
> switching  prandom_u32 instance to siphash.
> 
> Changes since v5:
> * Fixed coding style issues in mm/slab and mm/slab_common.
> * Deleted irrelevant changes which were appended accidentally in
>   arch/x86/mm/kaslr.
> 
> Changes since v4:
> * Changed only the arch/x86/mm/kaslr patch.
>   In particular, we replaced the use of prandom_bytes_state and
>   prandom_seed_state with siphash inside arch/x86/mm/kaslr.c.
> 
> Changes since v3:
> * edited commit messages
> 
> Changes since v2:
> * edited commit message.
> * replaced instances of get_random_u32 with get_random_u32_below
>       in mm/slab.c, mm/slab_common.c
> 
> Regards,
> 
> 
> David Keisar Schmidt (3):
>   mm/slab: Replace invocation of weak PRNG
>   mm/slab_common: Replace invocation of weak PRNG
>   arch/x86/mm/kaslr: use siphash instead of prandom_bytes_state
> 
>  arch/x86/mm/kaslr.c | 21 +++++++++++++++------
>  mm/slab.c           | 29 +++++++++--------------------
>  mm/slab_common.c    | 11 +++--------
>  3 files changed, 27 insertions(+), 34 deletions(-)
> 



      reply	other threads:[~2023-04-17 15:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-16 17:21 david.keisarschm
2023-04-17 15:26 ` Vlastimil Babka [this message]

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=20e3bfd8-851e-1e2a-76b5-7c705e4d1c3d@suse.cz \
    --to=vbabka@suse.cz \
    --cc=42.hyeyoo@gmail.com \
    --cc=Jason@zx2c4.com \
    --cc=akpm@linux-foundation.org \
    --cc=aksecurity@gmail.com \
    --cc=david.keisarschm@mail.huji.ac.il \
    --cc=hpa@zytor.com \
    --cc=ilay.bahat1@gmail.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@redhat.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