aboutsummaryrefslogtreecommitdiff
path: root/net/lapb/lapb_subr.c
diff options
context:
space:
mode:
authorNaoya Horiguchi <[email protected]>2019-02-01 14:21:08 -0800
committerLinus Torvalds <[email protected]>2019-02-01 15:46:23 -0800
commit6376360ecbe525a9c17b3d081dfd88ba3e4ed65b (patch)
tree215bed178518c6a6ecf4005927c3f598105cb3dc /net/lapb/lapb_subr.c
parent0d0c8de8788b6c441ea01365612de7efc20cc682 (diff)
mm: hwpoison: use do_send_sig_info() instead of force_sig()
Currently memory_failure() is racy against process's exiting, which results in kernel crash by null pointer dereference. The root cause is that memory_failure() uses force_sig() to forcibly kill asynchronous (meaning not in the current context) processes. As discussed in thread https://lkml.org/lkml/2010/6/8/236 years ago for OOM fixes, this is not a right thing to do. OOM solves this issue by using do_send_sig_info() as done in commit d2d393099de2 ("signal: oom_kill_task: use SEND_SIG_FORCED instead of force_sig()"), so this patch is suggesting to do the same for hwpoison. do_send_sig_info() properly accesses to siglock with lock_task_sighand(), so is free from the reported race. I confirmed that the reported bug reproduces with inserting some delay in kill_procs(), and it never reproduces with this patch. Note that memory_failure() can send another type of signal using force_sig_mceerr(), and the reported race shouldn't happen on it because force_sig_mceerr() is called only for synchronous processes (i.e. BUS_MCEERR_AR happens only when some process accesses to the corrupted memory.) Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Naoya Horiguchi <[email protected]> Reported-by: Jane Chu <[email protected]> Reviewed-by: Dan Williams <[email protected]> Reviewed-by: William Kucharski <[email protected]> Cc: Oleg Nesterov <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'net/lapb/lapb_subr.c')
0 files changed, 0 insertions, 0 deletions