upgrade to linux 2.6.10-1.12_FC2
[linux-2.6.git] / arch / x86_64 / kernel / signal.c
index 99bcd72..4151cc7 100644 (file)
@@ -125,6 +125,12 @@ restore_sigcontext(struct pt_regs *regs, struct sigcontext __user *sc, unsigned
                        if (verify_area(VERIFY_READ, buf, sizeof(*buf)))
                                goto badframe;
                        err |= restore_i387(buf);
+               } else {
+                       struct task_struct *me = current;
+                       if (me->used_math) {
+                               clear_fpu(me);
+                               me->used_math = 0;
+                       }
                }
        }
 
@@ -325,7 +331,7 @@ static void setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
 
        set_fs(USER_DS);
        if (regs->eflags & TF_MASK) {
-               if (current->ptrace & PT_PTRACED) {
+               if ((current->ptrace & (PT_PTRACED | PT_DTRACE)) == (PT_PTRACED | PT_DTRACE)) {
                        ptrace_notify(SIGTRAP);
                } else {
                        regs->eflags &= ~TF_MASK;
@@ -357,7 +363,7 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
 #endif
 
        /* Are we from a system call? */
-       if (regs->orig_rax >= 0) {
+       if ((long)regs->orig_rax >= 0) {
                /* If so, check system call restarting.. */
                switch (regs->rax) {
                        case -ERESTART_RESTARTBLOCK:
@@ -442,7 +448,7 @@ int do_signal(struct pt_regs *regs, sigset_t *oldset)
 
  no_signal:
        /* Did we come from a system call? */
-       if (regs->orig_rax >= 0) {
+       if ((long)regs->orig_rax >= 0) {
                /* Restart the system call - no handlers present */
                long res = regs->rax;
                if (res == -ERESTARTNOHAND ||