Skip to content

Commit 3f19597

Browse files
davidhildenbrandtorvalds
authored andcommitted
kasan: fix memory hotplug during boot
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>
1 parent ed1596f commit 3f19597

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/kasan/kasan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -898,5 +898,5 @@ static int __init kasan_memhotplug_init(void)
898898
return 0;
899899
}
900900

901-
module_init(kasan_memhotplug_init);
901+
core_initcall(kasan_memhotplug_init);
902902
#endif

0 commit comments

Comments
 (0)