linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Garnier <thgarnie@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Lameter <cl@linux.com>,
	Pekka Enberg <penberg@kernel.org>,
	David Rientjes <rientjes@google.com>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Kees Cook <keescook@chromium.org>,
	Greg Thelen <gthelen@google.com>,
	Laura Abbott <labbott@fedoraproject.org>,
	kernel-hardening@lists.openwall.com,
	LKML <linux-kernel@vger.kernel.org>,
	Linux-MM <linux-mm@kvack.org>
Subject: Re: [PATCH v5] mm: SLAB freelist randomization
Date: Wed, 27 Apr 2016 13:04:17 -0700	[thread overview]
Message-ID: <CAJcbSZH1H2M2q7Kj_9+61O462uTNwNf5DFG1-qqm32d5rFqWaA@mail.gmail.com> (raw)
In-Reply-To: <20160427121617.5a3123d75230effd7842e408@linux-foundation.org>

On Wed, Apr 27, 2016 at 12:16 PM, Andrew Morton
<akpm@linux-foundation.org> wrote:
> On Wed, 27 Apr 2016 10:20:59 -0700 Thomas Garnier <thgarnie@google.com> wrote:
>
>> Provides an optional config (CONFIG_SLAB_FREELIST_RANDOM) to randomize
>> the SLAB freelist.
>
> Forgot this bit?
>

I thought I would change it when we support other kernel heaps.

> From: Andrew Morton <akpm@linux-foundation.org>
> Subject: mm-slab-freelist-randomization-v5-fix
>
> propagate gfp_t into cache_random_seq_create()
>
> Cc: Christoph Lameter <cl@linux.com>
> Cc: David Rientjes <rientjes@google.com>
> Cc: Greg Thelen <gthelen@google.com>
> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Laura Abbott <labbott@fedoraproject.org>
> Cc: Pekka Enberg <penberg@kernel.org>
> Cc: Thomas Garnier <thgarnie@google.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
>
> --- a/mm/slab.c~mm-slab-freelist-randomization-v5-fix
> +++ a/mm/slab.c
> @@ -1262,7 +1262,7 @@ static void freelist_randomize(struct rn
>  }
>
>  /* Create a random sequence per cache */
> -static int cache_random_seq_create(struct kmem_cache *cachep)
> +static int cache_random_seq_create(struct kmem_cache *cachep, gfp_t gfp)
>  {
>         unsigned int seed, count = cachep->num;
>         struct rnd_state state;
> @@ -1271,7 +1271,7 @@ static int cache_random_seq_create(struc
>                 return 0;
>
>         /* If it fails, we will just use the global lists */
> -       cachep->random_seq = kcalloc(count, sizeof(freelist_idx_t), GFP_KERNEL);
> +       cachep->random_seq = kcalloc(count, sizeof(freelist_idx_t), gfp);
>         if (!cachep->random_seq)
>                 return -ENOMEM;
>
> @@ -1290,7 +1290,7 @@ static void cache_random_seq_destroy(str
>         cachep->random_seq = NULL;
>  }
>  #else
> -static inline int cache_random_seq_create(struct kmem_cache *cachep)
> +static inline int cache_random_seq_create(struct kmem_cache *cachep, gfp_t gfp)
>  {
>         return 0;
>  }
> @@ -3999,7 +3999,7 @@ static int enable_cpucache(struct kmem_c
>         int shared = 0;
>         int batchcount = 0;
>
> -       err = cache_random_seq_create(cachep);
> +       err = cache_random_seq_create(cachep, gfp);
>         if (err)
>                 goto end;
>
> _
>

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2016-04-27 20:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-27 17:20 Thomas Garnier
2016-04-27 19:16 ` Andrew Morton
2016-04-27 20:04   ` Thomas Garnier [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=CAJcbSZH1H2M2q7Kj_9+61O462uTNwNf5DFG1-qqm32d5rFqWaA@mail.gmail.com \
    --to=thgarnie@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=cl@linux.com \
    --cc=gthelen@google.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=keescook@chromium.org \
    --cc=kernel-hardening@lists.openwall.com \
    --cc=labbott@fedoraproject.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=penberg@kernel.org \
    --cc=rientjes@google.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