Commit ca633fd0 authored by Oleg Nesterov's avatar Oleg Nesterov Committed by Martin Schwidefsky

[S390] ptrace: dont abuse PT_PTRACED

Nobody except ptrace itself should use task->ptrace or PT_PTRACED
directly, change arch/s390/kernel/traps.c to use the helper.
Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
Acked-by: default avatarRoland McGrath <roland@redhat.com>
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent d302e1a5
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/ptrace.h> #include <linux/tracehook.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/smp.h> #include <linux/smp.h>
...@@ -382,7 +382,7 @@ void __kprobes do_single_step(struct pt_regs *regs) ...@@ -382,7 +382,7 @@ void __kprobes do_single_step(struct pt_regs *regs)
SIGTRAP) == NOTIFY_STOP){ SIGTRAP) == NOTIFY_STOP){
return; return;
} }
if ((current->ptrace & PT_PTRACED) != 0) if (tracehook_consider_fatal_signal(current, SIGTRAP))
force_sig(SIGTRAP, current); force_sig(SIGTRAP, current);
} }
...@@ -483,7 +483,7 @@ static void illegal_op(struct pt_regs * regs, long interruption_code) ...@@ -483,7 +483,7 @@ static void illegal_op(struct pt_regs * regs, long interruption_code)
if (get_user(*((__u16 *) opcode), (__u16 __user *) location)) if (get_user(*((__u16 *) opcode), (__u16 __user *) location))
return; return;
if (*((__u16 *) opcode) == S390_BREAKPOINT_U16) { if (*((__u16 *) opcode) == S390_BREAKPOINT_U16) {
if (current->ptrace & PT_PTRACED) if (tracehook_consider_fatal_signal(current, SIGTRAP))
force_sig(SIGTRAP, current); force_sig(SIGTRAP, current);
else else
signal = SIGILL; signal = SIGILL;
......
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