kexec: bail out upon SIGKILL when allocating memory.

syzbot found that a thread can stall for minutes inside kexec_load() after
that thread was killed by SIGKILL [1].  It turned out that the reproducer
was trying to allocate 2408MB of memory using kimage_alloc_page() from
kimage_load_normal_segment().  Let's check for SIGKILL before doing memory


Signed-off-by: Tetsuo Handa <>
Reported-by: syzbot <>
Cc: Eric Biederman <>
Reviewed-by: Andrew Morton <>
Signed-off-by: Andrew Morton <>
1 file changed