aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/ptrace.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index fad5f1e8511f..973d727f5e84 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -373,6 +373,12 @@ static int ptrace_setsiginfo(struct task_struct *child, siginfo_t __user * data)
373#define is_singlestep(request) 0 373#define is_singlestep(request) 0
374#endif 374#endif
375 375
376#ifdef PTRACE_SINGLEBLOCK
377#define is_singleblock(request) ((request) == PTRACE_SINGLEBLOCK)
378#else
379#define is_singleblock(request) 0
380#endif
381
376#ifdef PTRACE_SYSEMU 382#ifdef PTRACE_SYSEMU
377#define is_sysemu_singlestep(request) ((request) == PTRACE_SYSEMU_SINGLESTEP) 383#define is_sysemu_singlestep(request) ((request) == PTRACE_SYSEMU_SINGLESTEP)
378#else 384#else
@@ -396,7 +402,11 @@ static int ptrace_resume(struct task_struct *child, long request, long data)
396 clear_tsk_thread_flag(child, TIF_SYSCALL_EMU); 402 clear_tsk_thread_flag(child, TIF_SYSCALL_EMU);
397#endif 403#endif
398 404
399 if (is_singlestep(request) || is_sysemu_singlestep(request)) { 405 if (is_singleblock(request)) {
406 if (unlikely(!arch_has_block_step()))
407 return -EIO;
408 user_enable_block_step(child);
409 } else if (is_singlestep(request) || is_sysemu_singlestep(request)) {
400 if (unlikely(!arch_has_single_step())) 410 if (unlikely(!arch_has_single_step()))
401 return -EIO; 411 return -EIO;
402 user_enable_single_step(child); 412 user_enable_single_step(child);
@@ -438,6 +448,9 @@ int ptrace_request(struct task_struct *child, long request,
438#ifdef PTRACE_SINGLESTEP 448#ifdef PTRACE_SINGLESTEP
439 case PTRACE_SINGLESTEP: 449 case PTRACE_SINGLESTEP:
440#endif 450#endif
451#ifdef PTRACE_SINGLEBLOCK
452 case PTRACE_SINGLEBLOCK:
453#endif
441#ifdef PTRACE_SYSEMU 454#ifdef PTRACE_SYSEMU
442 case PTRACE_SYSEMU: 455 case PTRACE_SYSEMU:
443 case PTRACE_SYSEMU_SINGLESTEP: 456 case PTRACE_SYSEMU_SINGLESTEP: