Skip to content

Commit

Permalink
kasan: fix memory hotplug during boot
Browse files Browse the repository at this point in the history
Using module_init() is wrong.  E.g.  ACPI adds and onlines memory before
our memory notifier gets registered.

This makes sure that ACPI memory detected during boot up will not result
in a kernel crash.

Easily reproducible with QEMU, just specify a DIMM when starting up.

Link: http://lkml.kernel.org/r/20180522100756.18478-3-david@redhat.com
Fixes: 786a895 ("kasan: disable memory hotplug")
Signed-off-by: David Hildenbrand <david@redhat.com>
Acked-by: Andrey Ryabinin <aryabinin@virtuozzo.com>
Cc: Alexander Potapenko <glider@google.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
davidhildenbrand authored and torvalds committed May 26, 2018
1 parent ed1596f commit 3f19597
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/kasan/kasan.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,5 +898,5 @@ static int __init kasan_memhotplug_init(void)
return 0;
}

module_init(kasan_memhotplug_init);
core_initcall(kasan_memhotplug_init);
#endif

0 comments on commit 3f19597

Please sign in to comment.