Skip to content
Commit 5405b42c authored by Jiashuo Liang's avatar Jiashuo Liang Committed by Borislav Petkov
Browse files

x86/fault: Don't send SIGSEGV twice on SEGV_PKUERR

__bad_area_nosemaphore() calls both force_sig_pkuerr() and
force_sig_fault() when handling SEGV_PKUERR. This does not cause
problems because the second signal is filtered by the legacy_queue()
check in __send_signal() because in both cases, the signal is SIGSEGV,
the second one seeing that the first one is already pending.

This causes the kernel to do unnecessary work so send the signal only
once for SEGV_PKUERR.

 [ bp: Massage commit message. ]

Fixes: 9db812db

 ("signal/x86: Call force_sig_pkuerr from __bad_area_nosemaphore")
Suggested-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: default avatarJiashuo Liang <liangjs@pku.edu.cn>
Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
Acked-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
Link: https://lkml.kernel.org/r/20210601085203.40214-1-liangjs@pku.edu.cn
parent f1d4d47c
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