ptrace: Remove tracehook_signal_handler
authorEric W. Biederman <ebiederm@xmission.com>
Thu, 27 Jan 2022 18:04:27 +0000 (12:04 -0600)
committerEric W. Biederman <ebiederm@xmission.com>
Thu, 10 Mar 2022 19:37:13 +0000 (13:37 -0600)
The two line function tracehook_signal_handler is only called from
signal_delivered.  Expand it inline in signal_delivered and remove it.
Just to make it easier to understand what is going on.

Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lkml.kernel.org/r/20220309162454.123006-5-ebiederm@xmission.com
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
arch/Kconfig
include/linux/tracehook.h
kernel/signal.c

index a517a949eb1d216eb1e725da76de96f2aa0f3ee3..6382520ef0a587d943a50f78886dd267ae95822f 100644 (file)
@@ -219,7 +219,6 @@ config TRACE_IRQFLAGS_SUPPORT
 #      CORE_DUMP_USE_REGSET    #define'd in linux/elf.h
 #      TIF_SYSCALL_TRACE       calls ptrace_report_syscall_{entry,exit}
 #      TIF_NOTIFY_RESUME       calls tracehook_notify_resume()
-#      signal delivery         calls tracehook_signal_handler()
 #
 config HAVE_ARCH_TRACEHOOK
        bool
index 819e82ac09bdff8125c2b2a711d7a0cf7b425f8e..b77bf49171967597f32d64354b8a1b17dfc66d63 100644 (file)
 struct linux_binprm;
 
 
-/**
- * tracehook_signal_handler - signal handler setup is complete
- * @stepping:          nonzero if debugger single-step or block-step in use
- *
- * Called by the arch code after a signal handler has been set up.
- * Register and stack state reflects the user handler about to run.
- * Signal mask changes have already been made.
- *
- * Called without locks, shortly before returning to user mode
- * (or handling more signals).
- */
-static inline void tracehook_signal_handler(int stepping)
-{
-       if (stepping)
-               ptrace_notify(SIGTRAP);
-}
-
 /**
  * set_notify_resume - cause tracehook_notify_resume() to be called
  * @task:              task that will call tracehook_notify_resume()
index 38602738866e3254186e4336b71544dacc787449..0e0bd1c1068bf1e2dfc319209a0dea567741402d 100644 (file)
@@ -2898,7 +2898,8 @@ static void signal_delivered(struct ksignal *ksig, int stepping)
        set_current_blocked(&blocked);
        if (current->sas_ss_flags & SS_AUTODISARM)
                sas_ss_reset(current);
-       tracehook_signal_handler(stepping);
+       if (stepping)
+               ptrace_notify(SIGTRAP);
 }
 
 void signal_setup_done(int failed, struct ksignal *ksig, int stepping)