Quantcast

[SRU][Yakkety][PATCH 0/1] mm/slub.c: fix random_seq offset destruction

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[SRU][Yakkety][PATCH 0/1] mm/slub.c: fix random_seq offset destruction

Joseph Salisbury-3
BugLink: http://bugs.launchpad.net/bugs/1663991

== SRU Justification ==
A bug was found in Yakkety, which causes a kernel call trace when the
bug reporter connects a third USB HDD to a USB hub.
After the trace, kswapd0 process uses 100% of CPU.  This is fixed by
mainline commit a810007afe239d59c1115fcaa06eb5b480f876e9.  This commit
was also cc'd to stable.  However, submitting a SRU request since
upstream 4.8.x is EOL.

Commit a810007afe239d59c1115fcaa06eb5b480f876e9 was added to mainline
in v4.10-rc8.


== Fix ==
commit a810007afe239d59c1115fcaa06eb5b480f876e9
Author: Sean Rees <[hidden email]>
Date:   Wed Feb 8 14:30:59 2017 -0800

    mm/slub.c: fix random_seq offset destruction

== Test Case ==
A test kernel was built with this patch and tested by the original bug reporter.
The bug reporter states the test kernel resolved the bug.


Sean Rees (1):
  mm/slub.c: fix random_seq offset destruction

 mm/slub.c | 4 ++++
 1 file changed, 4 insertions(+)

--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[SRU][Yakkety][PATCH 1/1] mm/slub.c: fix random_seq offset destruction

Joseph Salisbury-3
From: Sean Rees <[hidden email]>

BugLink: http://bugs.launchpad.net/bugs/1663991

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")
Link: http://lkml.kernel.org/r/20170207140707.20824-1-sean@...
Signed-off-by: Sean Rees <[hidden email]>
Reported-by: <[hidden email]>
Cc: Christoph Lameter <[hidden email]>
Cc: Pekka Enberg <[hidden email]>
Cc: David Rientjes <[hidden email]>
Cc: Joonsoo Kim <[hidden email]>
Cc: Thomas Garnier <[hidden email]>
Cc: <[hidden email]>
Signed-off-by: Andrew Morton <[hidden email]>
Signed-off-by: Linus Torvalds <[hidden email]>
(cherry picked from commit a810007afe239d59c1115fcaa06eb5b480f876e9)
Signed-off-by: Joseph Salisbury <[hidden email]>
---
 mm/slub.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/mm/slub.c b/mm/slub.c
index 379b796..0288bc5 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1423,6 +1423,10 @@ static int init_cache_random_seq(struct kmem_cache *s)
  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",
--
2.7.4


--
kernel-team mailing list
[hidden email]
https://lists.ubuntu.com/mailman/listinfo/kernel-team
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ACK: [SRU][Yakkety][PATCH 1/1] mm/slub.c: fix random_seq offset destruction

Tim Gardner-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

ACK: [SRU][Yakkety][PATCH 0/1] mm/slub.c: fix random_seq offset destruction

brad.figg
In reply to this post by Joseph Salisbury-3
Loading...