Commit 195bce73 authored by Eric W. Biederman's avatar Eric W. Biederman

signal/sh: Use force_sig_fault in hw_breakpoint_handler

The call chain is:
breakpoint
  notify_die
    hw_breakpoint_exceptions_notify
      hw_breakpoint_handler

So the signal number can only be SIGTRAP.

In hw_breakpoint_handler rc is either NOTIFY_STOP or NOTIF_DONE
both of which notifier_to_errno converts to 0.  So si_errno is 0.

Historically si_addr was left unitialized in struct siginfo which is a
bug.  There appears to be no consensus among the various architectures
which value should be in si_addr.  So since no usable value has
been returned up to this point return NULL in si_addr.

Fixes: 4352fc1b ("sh: Abstracted SH-4A UBC support on hw-breakpoint core.")
Fixes: 34d0b5af ("sh: Convert ptrace to hw_breakpoint API.")
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: Paul Mundt <lethal@linux-sh.org>
Cc: linux-sh@vger.kernel.org
Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
parent 32772c9e
...@@ -347,13 +347,8 @@ static int __kprobes hw_breakpoint_handler(struct die_args *args) ...@@ -347,13 +347,8 @@ static int __kprobes hw_breakpoint_handler(struct die_args *args)
/* Deliver the signal to userspace */ /* Deliver the signal to userspace */
if (!arch_check_bp_in_kernelspace(bp)) { if (!arch_check_bp_in_kernelspace(bp)) {
siginfo_t info; force_sig_fault(SIGTRAP, TRAP_HWBKPT,
(void __user *)NULL, current);
info.si_signo = args->signr;
info.si_errno = notifier_to_errno(rc);
info.si_code = TRAP_HWBKPT;
force_sig_info(args->signr, &info, current);
} }
rcu_read_unlock(); rcu_read_unlock();
......
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