Commit fa1ac57a317f927b8fb901e6270fc41fdaae8e1c

Authored by Christoph Hellwig
Committed by Linus Torvalds
1 parent 7a0fde8b3b

microblaze: use generic ptrace_resume code

Use the generic ptrace_resume code for PTRACE_SYSCALL, PTRACE_CONT and
PTRACE_KILL.  This also makes PTRACE_SINGLESTEP return -EIO while it
previously succeeded despite not actually causing any kind of single
stepping.

Also the TIF_SYSCALL_TRACE thread flag is now cleared on PTRACE_KILL which
it previously wasn't which is consistent with all architectures using the
modern ptrace code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Roland McGrath <roland@redhat.com>
Acked-by: Michal Simek <monstr@monstr.eu>
Cc: John Williams <john.williams@petalogix.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 0 additions and 37 deletions Side-by-side Diff

arch/microblaze/kernel/ptrace.c
... ... @@ -110,43 +110,6 @@
110 110 if (rval == 0 && request == PTRACE_PEEKUSR)
111 111 rval = put_user(val, (unsigned long *)data);
112 112 break;
113   - /* Continue and stop at next (return from) syscall */
114   - case PTRACE_SYSCALL:
115   - pr_debug("PTRACE_SYSCALL\n");
116   - case PTRACE_SINGLESTEP:
117   - pr_debug("PTRACE_SINGLESTEP\n");
118   - /* Restart after a signal. */
119   - case PTRACE_CONT:
120   - pr_debug("PTRACE_CONT\n");
121   - rval = -EIO;
122   - if (!valid_signal(data))
123   - break;
124   -
125   - if (request == PTRACE_SYSCALL)
126   - set_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
127   - else
128   - clear_tsk_thread_flag(child, TIF_SYSCALL_TRACE);
129   -
130   - child->exit_code = data;
131   - pr_debug("wakeup_process\n");
132   - wake_up_process(child);
133   - rval = 0;
134   - break;
135   -
136   - /*
137   - * make the child exit. Best I can do is send it a sigkill.
138   - * perhaps it should be put in the status that it wants to
139   - * exit.
140   - */
141   - case PTRACE_KILL:
142   - pr_debug("PTRACE_KILL\n");
143   - rval = 0;
144   - if (child->exit_state == EXIT_ZOMBIE) /* already dead */
145   - break;
146   - child->exit_code = SIGKILL;
147   - wake_up_process(child);
148   - break;
149   -
150 113 default:
151 114 rval = ptrace_request(child, request, addr, data);
152 115 }