Commit cb3c19c9 authored by Eric W. Biederman's avatar Eric W. Biederman

signal: Use lockdep_assert_held instead of assert_spin_locked

The distinction is that assert_spin_locked() checks if the lock is
held *by*anyone* whereas lockdep_assert_held() asserts the current
context holds the lock.  Also, the check goes away if you build
without lockdep.
Suggested-by: default avatarPeter Zijlstra <peterz@infradead.org>
Link: https://lkml.kernel.org/r/Ympr/+PX4XgT/UKU@hirez.programming.kicks-ass.netTested-by: default avatarKees Cook <keescook@chromium.org>
Reviewed-by: default avatarOleg Nesterov <oleg@redhat.com>
Link: https://lkml.kernel.org/r/20220505182645.497868-6-ebiederm@xmission.comSigned-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
parent 16cc1bc6
...@@ -884,7 +884,7 @@ static int check_kill_permission(int sig, struct kernel_siginfo *info, ...@@ -884,7 +884,7 @@ static int check_kill_permission(int sig, struct kernel_siginfo *info,
static void ptrace_trap_notify(struct task_struct *t) static void ptrace_trap_notify(struct task_struct *t)
{ {
WARN_ON_ONCE(!(t->ptrace & PT_SEIZED)); WARN_ON_ONCE(!(t->ptrace & PT_SEIZED));
assert_spin_locked(&t->sighand->siglock); lockdep_assert_held(&t->sighand->siglock);
task_set_jobctl_pending(t, JOBCTL_TRAP_NOTIFY); task_set_jobctl_pending(t, JOBCTL_TRAP_NOTIFY);
ptrace_signal_wake_up(t, t->jobctl & JOBCTL_LISTENING); ptrace_signal_wake_up(t, t->jobctl & JOBCTL_LISTENING);
...@@ -1079,7 +1079,7 @@ static int __send_signal_locked(int sig, struct kernel_siginfo *info, ...@@ -1079,7 +1079,7 @@ static int __send_signal_locked(int sig, struct kernel_siginfo *info,
int override_rlimit; int override_rlimit;
int ret = 0, result; int ret = 0, result;
assert_spin_locked(&t->sighand->siglock); lockdep_assert_held(&t->sighand->siglock);
result = TRACE_SIGNAL_IGNORED; result = TRACE_SIGNAL_IGNORED;
if (!prepare_signal(sig, t, force)) if (!prepare_signal(sig, t, force))
......
Markdown is supported
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