v2.4.8 -> v2.4.8.1
[opensuse:kernel.git] / arch / arm / kernel / signal.c
1 /*
2  *  linux/arch/arm/kernel/signal.c
3  *
4  *  Copyright (C) 1995, 1996 Russell King
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  */
10 #include <linux/config.h>
11 #include <linux/sched.h>
12 #include <linux/mm.h>
13 #include <linux/smp.h>
14 #include <linux/smp_lock.h>
15 #include <linux/kernel.h>
16 #include <linux/errno.h>
17 #include <linux/signal.h>
18 #include <linux/wait.h>
19 #include <linux/ptrace.h>
20 #include <linux/stddef.h>
21 #include <linux/unistd.h>
22 #include <linux/tty.h>
23
24 #include <asm/pgalloc.h>
25 #include <asm/ucontext.h>
26 #include <asm/uaccess.h>
27
28 #include "ptrace.h"
29
30 #define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))
31
32 #define SWI_SYS_SIGRETURN (0xef000000|(__NR_sigreturn))
33 #define SWI_SYS_RT_SIGRETURN (0xef000000|(__NR_rt_sigreturn))
34
35 asmlinkage int do_signal(sigset_t *oldset, struct pt_regs * regs, int syscall);
36
37 int copy_siginfo_to_user(siginfo_t *to, siginfo_t *from)
38 {
39         int err = -EFAULT;;
40
41         if (!access_ok (VERIFY_WRITE, to, sizeof(siginfo_t)))
42                 goto out;
43
44         if (from->si_code < 0)
45                 return __copy_to_user(to, from, sizeof(siginfo_t));
46
47         /* If you change siginfo_t structure, please be sure
48            this code is fixed accordingly.
49            It should never copy any pad contained in the structure
50            to avoid security leaks, but must copy the generic
51            3 ints plus the relevant union member.  */
52         err = __put_user(from->si_signo, &to->si_signo);
53         err |= __put_user(from->si_errno, &to->si_errno);
54         err |= __put_user((short)from->si_code, &to->si_code);
55         /* First 32bits of unions are always present.  */
56         err |= __put_user(from->si_pid, &to->si_pid);
57         switch (from->si_code >> 16) {
58         case __SI_FAULT >> 16:
59                 break;
60         case __SI_CHLD >> 16:
61                 err |= __put_user(from->si_utime, &to->si_utime);
62                 err |= __put_user(from->si_stime, &to->si_stime);
63                 err |= __put_user(from->si_status, &to->si_status);
64         default:
65                 err |= __put_user(from->si_uid, &to->si_uid);
66                 break;
67         /* case __SI_RT: This is not generated by the kernel as of now.  */
68         }
69 out:
70         return err;
71 }
72
73 /*
74  * atomically swap in the new signal mask, and wait for a signal.
75  */
76 asmlinkage int sys_sigsuspend(int restart, unsigned long oldmask, old_sigset_t mask, struct pt_regs *regs)
77 {
78         sigset_t saveset;
79
80         mask &= _BLOCKABLE;
81         spin_lock_irq(&current->sigmask_lock);
82         saveset = current->blocked;
83         siginitset(&current->blocked, mask);
84         recalc_sigpending(current);
85         spin_unlock_irq(&current->sigmask_lock);
86         regs->ARM_r0 = -EINTR;
87
88         while (1) {
89                 current->state = TASK_INTERRUPTIBLE;
90                 schedule();
91                 if (do_signal(&saveset, regs, 0))
92                         return regs->ARM_r0;
93         }
94 }
95
96 asmlinkage int
97 sys_rt_sigsuspend(sigset_t *unewset, size_t sigsetsize, struct pt_regs *regs)
98 {
99         sigset_t saveset, newset;
100
101         /* XXX: Don't preclude handling different sized sigset_t's. */
102         if (sigsetsize != sizeof(sigset_t))
103                 return -EINVAL;
104
105         if (copy_from_user(&newset, unewset, sizeof(newset)))
106                 return -EFAULT;
107         sigdelsetmask(&newset, ~_BLOCKABLE);
108
109         spin_lock_irq(&current->sigmask_lock);
110         saveset = current->blocked;
111         current->blocked = newset;
112         recalc_sigpending(current);
113         spin_unlock_irq(&current->sigmask_lock);
114         regs->ARM_r0 = -EINTR;
115
116         while (1) {
117                 current->state = TASK_INTERRUPTIBLE;
118                 schedule();
119                 if (do_signal(&saveset, regs, 0))
120                         return regs->ARM_r0;
121         }
122 }
123
124 asmlinkage int 
125 sys_sigaction(int sig, const struct old_sigaction *act,
126               struct old_sigaction *oact)
127 {
128         struct k_sigaction new_ka, old_ka;
129         int ret;
130
131         if (act) {
132                 old_sigset_t mask;
133                 if (verify_area(VERIFY_READ, act, sizeof(*act)) ||
134                     __get_user(new_ka.sa.sa_handler, &act->sa_handler) ||
135                     __get_user(new_ka.sa.sa_restorer, &act->sa_restorer))
136                         return -EFAULT;
137                 __get_user(new_ka.sa.sa_flags, &act->sa_flags);
138                 __get_user(mask, &act->sa_mask);
139                 siginitset(&new_ka.sa.sa_mask, mask);
140         }
141
142         ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL);
143
144         if (!ret && oact) {
145                 if (verify_area(VERIFY_WRITE, oact, sizeof(*oact)) ||
146                     __put_user(old_ka.sa.sa_handler, &oact->sa_handler) ||
147                     __put_user(old_ka.sa.sa_restorer, &oact->sa_restorer))
148                         return -EFAULT;
149                 __put_user(old_ka.sa.sa_flags, &oact->sa_flags);
150                 __put_user(old_ka.sa.sa_mask.sig[0], &oact->sa_mask);
151         }
152
153         return ret;
154 }
155
156 /*
157  * Do a signal return; undo the signal stack.
158  */
159 struct sigframe
160 {
161         struct sigcontext sc;
162         unsigned long extramask[_NSIG_WORDS-1];
163         unsigned long retcode;
164 };
165
166 struct rt_sigframe
167 {
168         struct siginfo *pinfo;
169         void *puc;
170         struct siginfo info;
171         struct ucontext uc;
172         unsigned long retcode;
173 };
174
175 static int
176 restore_sigcontext(struct pt_regs *regs, struct sigcontext *sc)
177 {
178         int err = 0;
179
180         __get_user_error(regs->ARM_r0, &sc->arm_r0, err);
181         __get_user_error(regs->ARM_r1, &sc->arm_r1, err);
182         __get_user_error(regs->ARM_r2, &sc->arm_r2, err);
183         __get_user_error(regs->ARM_r3, &sc->arm_r3, err);
184         __get_user_error(regs->ARM_r4, &sc->arm_r4, err);
185         __get_user_error(regs->ARM_r5, &sc->arm_r5, err);
186         __get_user_error(regs->ARM_r6, &sc->arm_r6, err);
187         __get_user_error(regs->ARM_r7, &sc->arm_r7, err);
188         __get_user_error(regs->ARM_r8, &sc->arm_r8, err);
189         __get_user_error(regs->ARM_r9, &sc->arm_r9, err);
190         __get_user_error(regs->ARM_r10, &sc->arm_r10, err);
191         __get_user_error(regs->ARM_fp, &sc->arm_fp, err);
192         __get_user_error(regs->ARM_ip, &sc->arm_ip, err);
193         __get_user_error(regs->ARM_sp, &sc->arm_sp, err);
194         __get_user_error(regs->ARM_lr, &sc->arm_lr, err);
195         __get_user_error(regs->ARM_pc, &sc->arm_pc, err);
196 #ifdef CONFIG_CPU_32
197         __get_user_error(regs->ARM_cpsr, &sc->arm_cpsr, err);
198 #endif
199
200         err |= !valid_user_regs(regs);
201
202         return err;
203 }
204
205 asmlinkage int sys_sigreturn(struct pt_regs *regs)
206 {
207         struct sigframe *frame;
208         sigset_t set;
209
210         /*
211          * Since we stacked the signal on a word boundary,
212          * then 'sp' should be word aligned here.  If it's
213          * not, then the user is trying to mess with us.
214          */
215         if (regs->ARM_sp & 3)
216                 goto badframe;
217
218         frame = (struct sigframe *)regs->ARM_sp;
219
220         if (verify_area(VERIFY_READ, frame, sizeof (*frame)))
221                 goto badframe;
222         if (__get_user(set.sig[0], &frame->sc.oldmask)
223             || (_NSIG_WORDS > 1
224                 && __copy_from_user(&set.sig[1], &frame->extramask,
225                                     sizeof(frame->extramask))))
226                 goto badframe;
227
228         sigdelsetmask(&set, ~_BLOCKABLE);
229         spin_lock_irq(&current->sigmask_lock);
230         current->blocked = set;
231         recalc_sigpending(current);
232         spin_unlock_irq(&current->sigmask_lock);
233
234         if (restore_sigcontext(regs, &frame->sc))
235                 goto badframe;
236
237         /* Send SIGTRAP if we're single-stepping */
238         if (ptrace_cancel_bpt(current))
239                 send_sig(SIGTRAP, current, 1);
240
241         return regs->ARM_r0;
242
243 badframe:
244         force_sig(SIGSEGV, current);
245         return 0;
246 }
247
248 asmlinkage int sys_rt_sigreturn(struct pt_regs *regs)
249 {
250         struct rt_sigframe *frame;
251         sigset_t set;
252
253         /*
254          * Since we stacked the signal on a word boundary,
255          * then 'sp' should be word aligned here.  If it's
256          * not, then the user is trying to mess with us.
257          */
258         if (regs->ARM_sp & 3)
259                 goto badframe;
260
261         frame = (struct rt_sigframe *)regs->ARM_sp;
262
263         if (verify_area(VERIFY_READ, frame, sizeof (*frame)))
264                 goto badframe;
265         if (__copy_from_user(&set, &frame->uc.uc_sigmask, sizeof(set)))
266                 goto badframe;
267
268         sigdelsetmask(&set, ~_BLOCKABLE);
269         spin_lock_irq(&current->sigmask_lock);
270         current->blocked = set;
271         recalc_sigpending(current);
272         spin_unlock_irq(&current->sigmask_lock);
273
274         if (restore_sigcontext(regs, &frame->uc.uc_mcontext))
275                 goto badframe;
276
277         /* Send SIGTRAP if we're single-stepping */
278         if (ptrace_cancel_bpt(current))
279                 send_sig(SIGTRAP, current, 1);
280
281         return regs->ARM_r0;
282
283 badframe:
284         force_sig(SIGSEGV, current);
285         return 0;
286 }
287
288 static int
289 setup_sigcontext(struct sigcontext *sc, /*struct _fpstate *fpstate,*/
290                  struct pt_regs *regs, unsigned long mask)
291 {
292         int err = 0;
293
294         __put_user_error(regs->ARM_r0, &sc->arm_r0, err);
295         __put_user_error(regs->ARM_r1, &sc->arm_r1, err);
296         __put_user_error(regs->ARM_r2, &sc->arm_r2, err);
297         __put_user_error(regs->ARM_r3, &sc->arm_r3, err);
298         __put_user_error(regs->ARM_r4, &sc->arm_r4, err);
299         __put_user_error(regs->ARM_r5, &sc->arm_r5, err);
300         __put_user_error(regs->ARM_r6, &sc->arm_r6, err);
301         __put_user_error(regs->ARM_r7, &sc->arm_r7, err);
302         __put_user_error(regs->ARM_r8, &sc->arm_r8, err);
303         __put_user_error(regs->ARM_r9, &sc->arm_r9, err);
304         __put_user_error(regs->ARM_r10, &sc->arm_r10, err);
305         __put_user_error(regs->ARM_fp, &sc->arm_fp, err);
306         __put_user_error(regs->ARM_ip, &sc->arm_ip, err);
307         __put_user_error(regs->ARM_sp, &sc->arm_sp, err);
308         __put_user_error(regs->ARM_lr, &sc->arm_lr, err);
309         __put_user_error(regs->ARM_pc, &sc->arm_pc, err);
310 #ifdef CONFIG_CPU_32
311         __put_user_error(regs->ARM_cpsr, &sc->arm_cpsr, err);
312 #endif
313
314         __put_user_error(current->thread.trap_no, &sc->trap_no, err);
315         __put_user_error(current->thread.error_code, &sc->error_code, err);
316         __put_user_error(current->thread.address, &sc->fault_address, err);
317         __put_user_error(mask, &sc->oldmask, err);
318
319         return err;
320 }
321
322 static inline void *get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
323                                  unsigned long framesize)
324 {
325         unsigned long sp = regs->ARM_sp;
326
327         /*
328          * This is the X/Open sanctioned signal stack switching.
329          */
330         if ((ka->sa.sa_flags & SA_ONSTACK) && sas_ss_flags(sp))
331                 sp = current->sas_ss_sp + current->sas_ss_size;
332
333         /*
334          * No matter what happens, 'sp' must be word
335          * aligned otherwise nasty things could happen
336          */
337         /* ATPCS B01 mandates 8-byte alignment */
338         return (void *)((sp - framesize) & ~7);
339 }
340
341 static void setup_frame(int sig, struct k_sigaction *ka,
342                         sigset_t *set, struct pt_regs *regs)
343 {
344         struct sigframe *frame;
345         unsigned long retcode;
346         int err = 0;
347
348         frame = get_sigframe(ka, regs, sizeof(*frame));
349
350         if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
351                 goto segv_and_exit;
352
353         err |= setup_sigcontext(&frame->sc, /*&frame->fpstate,*/ regs, set->sig[0]);
354
355         if (_NSIG_WORDS > 1) {
356                 err |= __copy_to_user(frame->extramask, &set->sig[1],
357                                       sizeof(frame->extramask));
358         }
359
360         /* Set up to return from userspace.  If provided, use a stub
361            already in userspace.  */
362         if (ka->sa.sa_flags & SA_RESTORER) {
363                 retcode = (unsigned long)ka->sa.sa_restorer;
364         } else {
365                 retcode = (unsigned long)&frame->retcode;
366                 __put_user_error(SWI_SYS_SIGRETURN, &frame->retcode, err);
367                 flush_icache_range(retcode, retcode + 4);
368         }
369
370         if (err)
371                 goto segv_and_exit;
372
373         if (current->exec_domain && current->exec_domain->signal_invmap && sig < 32)
374                 regs->ARM_r0 = current->exec_domain->signal_invmap[sig];
375         else
376                 regs->ARM_r0 = sig;
377         regs->ARM_sp = (unsigned long)frame;
378         regs->ARM_lr = retcode;
379         regs->ARM_pc = (unsigned long)ka->sa.sa_handler;
380 #if defined(CONFIG_CPU_32)
381         /* Maybe we need to deliver a 32-bit signal to a 26-bit task. */
382         if (ka->sa.sa_flags & SA_THIRTYTWO)
383                 regs->ARM_cpsr = USR_MODE;
384 #endif
385         if (valid_user_regs(regs))
386                 return;
387
388 segv_and_exit:
389         if (sig == SIGSEGV)
390                 ka->sa.sa_handler = SIG_DFL;
391         force_sig(SIGSEGV, current);
392 }
393
394 static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
395                            sigset_t *set, struct pt_regs *regs)
396 {
397         struct rt_sigframe *frame;
398         unsigned long retcode;
399         int err = 0;
400
401         frame = get_sigframe(ka, regs, sizeof(struct rt_sigframe));
402
403         if (!access_ok(VERIFY_WRITE, frame, sizeof (*frame)))
404                 goto segv_and_exit;
405
406         __put_user_error(&frame->info, &frame->pinfo, err);
407         __put_user_error(&frame->uc, &frame->puc, err);
408         err |= copy_siginfo_to_user(&frame->info, info);
409
410         /* Clear all the bits of the ucontext we don't use.  */
411         err |= __clear_user(&frame->uc, offsetof(struct ucontext, uc_mcontext));
412
413         err |= setup_sigcontext(&frame->uc.uc_mcontext, /*&frame->fpstate,*/
414                                 regs, set->sig[0]);
415         err |= __copy_to_user(&frame->uc.uc_sigmask, set, sizeof(*set));
416
417         /* Set up to return from userspace.  If provided, use a stub
418            already in userspace.  */
419         if (ka->sa.sa_flags & SA_RESTORER) {
420                 retcode = (unsigned long)ka->sa.sa_restorer;
421         } else {
422                 retcode = (unsigned long)&frame->retcode;
423                 __put_user_error(SWI_SYS_RT_SIGRETURN, &frame->retcode, err);
424                 flush_icache_range(retcode, retcode + 4);
425         }
426
427         if (err)
428                 goto segv_and_exit;
429
430         if (current->exec_domain && current->exec_domain->signal_invmap && sig < 32)
431                 regs->ARM_r0 = current->exec_domain->signal_invmap[sig];
432         else
433                 regs->ARM_r0 = sig;
434
435         /*
436          * For realtime signals we must also set the second and third
437          * arguments for the signal handler.
438          *   -- Peter Maydell <pmaydell@chiark.greenend.org.uk> 2000-12-06
439          */
440         regs->ARM_r1 = (unsigned long)frame->pinfo;
441         regs->ARM_r2 = (unsigned long)frame->puc;
442
443         regs->ARM_sp = (unsigned long)frame;
444         regs->ARM_lr = retcode;
445         regs->ARM_pc = (unsigned long)ka->sa.sa_handler;
446 #if defined(CONFIG_CPU_32)
447         /* Maybe we need to deliver a 32-bit signal to a 26-bit task. */
448         if (ka->sa.sa_flags & SA_THIRTYTWO)
449                 regs->ARM_cpsr = USR_MODE;
450 #endif
451         if (valid_user_regs(regs))
452                 return;
453
454 segv_and_exit:
455         if (sig == SIGSEGV)
456                 ka->sa.sa_handler = SIG_DFL;
457         force_sig(SIGSEGV, current);
458 }
459
460 /*
461  * OK, we're invoking a handler
462  */     
463 static void
464 handle_signal(unsigned long sig, struct k_sigaction *ka,
465               siginfo_t *info, sigset_t *oldset, struct pt_regs * regs)
466 {
467         /* Set up the stack frame */
468         if (ka->sa.sa_flags & SA_SIGINFO)
469                 setup_rt_frame(sig, ka, info, oldset, regs);
470         else
471                 setup_frame(sig, ka, oldset, regs);
472
473         if (ka->sa.sa_flags & SA_ONESHOT)
474                 ka->sa.sa_handler = SIG_DFL;
475
476         if (!(ka->sa.sa_flags & SA_NODEFER)) {
477                 spin_lock_irq(&current->sigmask_lock);
478                 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
479                 sigaddset(&current->blocked,sig);
480                 recalc_sigpending(current);
481                 spin_unlock_irq(&current->sigmask_lock);
482         }
483 }
484
485 /*
486  * Note that 'init' is a special process: it doesn't get signals it doesn't
487  * want to handle. Thus you cannot kill init even with a SIGKILL even by
488  * mistake.
489  *
490  * Note that we go through the signals twice: once to check the signals that
491  * the kernel can handle, and then we build all the user-level signal handling
492  * stack-frames in one go after that.
493  */
494 asmlinkage int do_signal(sigset_t *oldset, struct pt_regs *regs, int syscall)
495 {
496         struct k_sigaction *ka;
497         siginfo_t info;
498         int single_stepping;
499
500         /*
501          * We want the common case to go fast, which
502          * is why we may in certain cases get here from
503          * kernel mode. Just return without doing anything
504          * if so.
505          */
506         if (!user_mode(regs))
507                 return 0;
508
509         if (!oldset)
510                 oldset = &current->blocked;
511
512         single_stepping = ptrace_cancel_bpt(current);
513
514         for (;;) {
515                 unsigned long signr;
516
517                 spin_lock_irq (&current->sigmask_lock);
518                 signr = dequeue_signal(&current->blocked, &info);
519                 spin_unlock_irq (&current->sigmask_lock);
520
521                 if (!signr)
522                         break;
523
524                 if ((current->ptrace & PT_PTRACED) && signr != SIGKILL) {
525                         /* Let the debugger run.  */
526                         current->exit_code = signr;
527                         current->state = TASK_STOPPED;
528                         notify_parent(current, SIGCHLD);
529                         schedule();
530                         single_stepping |= ptrace_cancel_bpt(current);
531
532                         /* We're back.  Did the debugger cancel the sig?  */
533                         if (!(signr = current->exit_code))
534                                 continue;
535                         current->exit_code = 0;
536
537                         /* The debugger continued.  Ignore SIGSTOP.  */
538                         if (signr == SIGSTOP)
539                                 continue;
540
541                         /* Update the siginfo structure.  Is this good? */
542                         if (signr != info.si_signo) {
543                                 info.si_signo = signr;
544                                 info.si_errno = 0;
545                                 info.si_code = SI_USER;
546                                 info.si_pid = current->p_pptr->pid;
547                                 info.si_uid = current->p_pptr->uid;
548                         }
549
550                         /* If the (new) signal is now blocked, requeue it.  */
551                         if (sigismember(&current->blocked, signr)) {
552                                 send_sig_info(signr, &info, current);
553                                 continue;
554                         }
555                 }
556
557                 ka = &current->sig->action[signr-1];
558                 if (ka->sa.sa_handler == SIG_IGN) {
559                         if (signr != SIGCHLD)
560                                 continue;
561                         /* Check for SIGCHLD: it's special.  */
562                         while (sys_wait4(-1, NULL, WNOHANG, NULL) > 0)
563                                 /* nothing */;
564                         continue;
565                 }
566
567                 if (ka->sa.sa_handler == SIG_DFL) {
568                         int exit_code = signr;
569
570                         /* Init gets no signals it doesn't want.  */
571                         if (current->pid == 1)
572                                 continue;
573
574                         switch (signr) {
575                         case SIGCONT: case SIGCHLD: case SIGWINCH:
576                                 continue;
577
578                         case SIGTSTP: case SIGTTIN: case SIGTTOU:
579                                 if (is_orphaned_pgrp(current->pgrp))
580                                         continue;
581                                 /* FALLTHRU */
582
583                         case SIGSTOP:
584                                 current->state = TASK_STOPPED;
585                                 current->exit_code = signr;
586                                 if (!(current->p_pptr->sig->action[SIGCHLD-1].sa.sa_flags & SA_NOCLDSTOP))
587                                         notify_parent(current, SIGCHLD);
588                                 schedule();
589                                 continue;
590
591                         case SIGQUIT: case SIGILL: case SIGTRAP:
592                         case SIGABRT: case SIGFPE: case SIGSEGV:
593                         case SIGBUS: case SIGSYS: case SIGXCPU: case SIGXFSZ:
594                                 if (do_coredump(signr, regs))
595                                         exit_code |= 0x80;
596                                 /* FALLTHRU */
597
598                         default:
599                                 sigaddset(&current->pending.signal, signr);
600                                 recalc_sigpending(current);
601                                 current->flags |= PF_SIGNALED;
602                                 do_exit(exit_code);
603                                 /* NOTREACHED */
604                         }
605                 }
606
607                 /* Are we from a system call? */
608                 if (syscall) {
609                         switch (regs->ARM_r0) {
610                         case -ERESTARTNOHAND:
611                                 regs->ARM_r0 = -EINTR;
612                                 break;
613
614                         case -ERESTARTSYS:
615                                 if (!(ka->sa.sa_flags & SA_RESTART)) {
616                                         regs->ARM_r0 = -EINTR;
617                                         break;
618                                 }
619                                 /* fallthrough */
620                         case -ERESTARTNOINTR:
621                                 regs->ARM_r0 = regs->ARM_ORIG_r0;
622                                 regs->ARM_pc -= 4;
623                         }
624                 }
625                 /* Whee!  Actually deliver the signal.  */
626                 handle_signal(signr, ka, &info, oldset, regs);
627                 if (single_stepping)
628                         ptrace_set_bpt(current);
629                 return 1;
630         }
631
632         if (syscall &&
633             (regs->ARM_r0 == -ERESTARTNOHAND ||
634              regs->ARM_r0 == -ERESTARTSYS ||
635              regs->ARM_r0 == -ERESTARTNOINTR)) {
636                 regs->ARM_r0 = regs->ARM_ORIG_r0;
637                 regs->ARM_pc -= 4;
638         }
639         if (single_stepping)
640                 ptrace_set_bpt(current);
641         return 0;
642 }