History

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.

Eric W. Biederman committed 4 years ago

Commit cb3c19c1 parent 16cc1bc1 file · +2 −2Browse files

Unified · Split

kernel/signal.c+2−2
@@ -884,7 +884,7 @@ static int check_kill_permission(int sig, struct kernel_siginfo *info, · 883 unmodified lines
884static void ptrace_trap_notify(struct task_struct *t)884static void ptrace_trap_notify(struct task_struct *t)
885{885{
886 WARN_ON_ONCE(!(t->ptrace & PT_SEIZED));886 WARN_ON_ONCE(!(t->ptrace & PT_SEIZED));
887 assert_spin_locked(&t->sighand->siglock);887 lockdep_assert_held(&t->sighand->siglock);
888 888
889 task_set_jobctl_pending(t, JOBCTL_TRAP_NOTIFY);889 task_set_jobctl_pending(t, JOBCTL_TRAP_NOTIFY);
890 ptrace_signal_wake_up(t, t->jobctl & JOBCTL_LISTENING);890 ptrace_signal_wake_up(t, t->jobctl & JOBCTL_LISTENING);
@@ -1079,7 +1079,7 @@ static int __send_signal_locked(int sig, struct kernel_siginfo *info, · 188 unmodified lines
1079 int override_rlimit;1079 int override_rlimit;
1080 int ret = 0, result;1080 int ret = 0, result;
1081 1081
1082 assert_spin_locked(&t->sighand->siglock);1082 lockdep_assert_held(&t->sighand->siglock);
1083 1083
1084 result = TRACE_SIGNAL_IGNORED;1084 result = TRACE_SIGNAL_IGNORED;
1085 if (!prepare_signal(sig, t, force))1085 if (!prepare_signal(sig, t, force))