Skip to content

Commit f9a38ea

Browse files
Al Virorichardweinberger
authored andcommitted
um: let signal_delivered() do SIGTRAP on singlestepping into handler
... rather than duplicating that in sigframe setup code (and doing that inconsistently, at that) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent bf56d57 commit f9a38ea

2 files changed

Lines changed: 5 additions & 7 deletions

File tree

‎arch/um/kernel/signal.c‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@ static void handle_signal(struct pt_regs *regs, unsigned long signr,
2222
struct k_sigaction *ka, siginfo_t *info)
2323
{
2424
sigset_t *oldset = sigmask_to_save();
25+
int singlestep = 0;
2526
unsigned long sp;
2627
int err;
2728

29+
if ((current->ptrace & PT_DTRACE) && (current->ptrace & PT_PTRACED))
30+
singlestep = 1;
31+
2832
/* Did we come from a system call? */
2933
if (PT_REGS_SYSCALL_NR(regs) >= 0) {
3034
/* If so, check system call restarting.. */
@@ -61,7 +65,7 @@ static void handle_signal(struct pt_regs *regs, unsigned long signr,
6165
if (err)
6266
force_sigsegv(signr, current);
6367
else
64-
signal_delivered(signr, info, ka, regs, 0);
68+
signal_delivered(signr, info, ka, regs, singlestep);
6569
}
6670

6771
static int kern_do_signal(struct pt_regs *regs)

‎arch/x86/um/signal.c‎

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -416,9 +416,6 @@ int setup_signal_stack_sc(unsigned long stack_top, int sig,
416416
PT_REGS_AX(regs) = (unsigned long) sig;
417417
PT_REGS_DX(regs) = (unsigned long) 0;
418418
PT_REGS_CX(regs) = (unsigned long) 0;
419-
420-
if ((current->ptrace & PT_DTRACE) && (current->ptrace & PT_PTRACED))
421-
ptrace_notify(SIGTRAP);
422419
return 0;
423420
}
424421

@@ -466,9 +463,6 @@ int setup_signal_stack_si(unsigned long stack_top, int sig,
466463
PT_REGS_AX(regs) = (unsigned long) sig;
467464
PT_REGS_DX(regs) = (unsigned long) &frame->info;
468465
PT_REGS_CX(regs) = (unsigned long) &frame->uc;
469-
470-
if ((current->ptrace & PT_DTRACE) && (current->ptrace & PT_PTRACED))
471-
ptrace_notify(SIGTRAP);
472466
return 0;
473467
}
474468

0 commit comments

Comments
 (0)