Commit 39cb2588 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Force cache alignment of task_structs

I enabled the advanced use-after-free detector for large slab objects and the
kernel oopsed.  This is because that debug code adds things at the head of
the slab objects, and the kernel will die if task_structs are not
well-aligned.

The way to tell the slab allocator that it is not allowed to misalign objects
from this slab is SLAB_MUST_HWCACHE_ALIGN.
parent 14fe8153
...@@ -188,7 +188,7 @@ void __init fork_init(unsigned long mempages) ...@@ -188,7 +188,7 @@ void __init fork_init(unsigned long mempages)
task_struct_cachep = task_struct_cachep =
kmem_cache_create("task_struct", kmem_cache_create("task_struct",
sizeof(struct task_struct),0, sizeof(struct task_struct),0,
SLAB_HWCACHE_ALIGN, NULL, NULL); SLAB_MUST_HWCACHE_ALIGN, NULL, NULL);
if (!task_struct_cachep) if (!task_struct_cachep)
panic("fork_init(): cannot create task_struct SLAB cache"); panic("fork_init(): cannot create task_struct SLAB cache");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment