Skip to contentSkip to conversation

Patch "mm/slub.c: fix random_seq offset destruction" has been added to the 4.9-stable tree

PATCH [email protected] 1 participant 1 message Feb 10, 2017

Subsystems (3)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

mm/slub.c: fix random_seq offset destruction

to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
mm-slub.c-fix-random_seq-offset-destruction.patch
and it can be found in the queue-4.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From a810007afe239d59c1115fcaa06eb5b480f876e9 Mon Sep 17 00:00:00 2001

From: Sean Rees <[email protected]>
Date: Wed, 8 Feb 2017 14:30:59 -0800
Subject: mm/slub.c: fix random_seq offset destruction

From: Sean Rees <[email protected]>

commit a810007afe239d59c1115fcaa06eb5b480f876e9 upstream.

Commit 210e7a43fa90 ("mm: SLUB freelist randomization") broke USB hub initialisation as described in

https://bugzilla.kernel.org/show_bug.cgi?id=177551.

Bail out early from init_cache_random_seq if s->random_seq is already initialised. This prevents destroying the previously computed random_seq offsets later in the function.

If the offsets are destroyed, then shuffle_freelist will truncate page->freelist to just the first object (orphaning the rest).

Fixes 210e7a43fa90 ("mm: SLUB freelist randomization")
Cc Christoph Lameter <[email protected]>
Cc Pekka Enberg <[email protected]>
Cc David Rientjes <[email protected]>
Cc Joonsoo Kim <[email protected]>
Cc Thomas Garnier <[email protected]>
---
 mm/slub.c |    4 ++++
 1 file changed, 4 insertions(+)
mm/slub.c +4 -0
@@ -1419,6 +1419,10 @@ static int init_cache_random_seq(struct
 	int err;
 	unsigned long i, count = oo_objects(s->oo);
 
+	/* Bailout if already initialised */
+	if (s->random_seq)
+		return 0;
+
 	err = cache_random_seq_create(s, count, GFP_KERNEL);
 	if (err) {
 		pr_err("SLUB: Unable to initialize free list for %s\n",

Patches currently in stable-queue which might be from [email protected] are

queue-4.9/mm-slub.c-fix-random_seq-offset-destruction.patch