Skip to content

Commit cb3c19c

Browse files
committed
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: Peter Zijlstra <[email protected]> Link: https://lkml.kernel.org/r/Ympr/+PX4XgT/[email protected] Tested-by: Kees Cook <[email protected]> Reviewed-by: Oleg Nesterov <[email protected]> Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: "Eric W. Biederman" <[email protected]>
1 parent 16cc1bc commit cb3c19c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kernel/signal.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ static int check_kill_permission(int sig, struct kernel_siginfo *info,
884884
static void ptrace_trap_notify(struct task_struct *t)
885885
{
886886
WARN_ON_ONCE(!(t->ptrace & PT_SEIZED));
887-
assert_spin_locked(&t->sighand->siglock);
887+
lockdep_assert_held(&t->sighand->siglock);
888888

889889
task_set_jobctl_pending(t, JOBCTL_TRAP_NOTIFY);
890890
ptrace_signal_wake_up(t, t->jobctl & JOBCTL_LISTENING);
@@ -1079,7 +1079,7 @@ static int __send_signal_locked(int sig, struct kernel_siginfo *info,
10791079
int override_rlimit;
10801080
int ret = 0, result;
10811081

1082-
assert_spin_locked(&t->sighand->siglock);
1082+
lockdep_assert_held(&t->sighand->siglock);
10831083

10841084
result = TRACE_SIGNAL_IGNORED;
10851085
if (!prepare_signal(sig, t, force))

0 commit comments

Comments
 (0)