~ubuntu-branches/ubuntu/oneiric/linux-ti-omap4/oneiric-updates

« back to all changes in this revision

Viewing changes to kernel/signal.c

  • Committer: Package Import Robot
  • Author(s): Paolo Pisati, Paolo Pisati, Ubuntu: 3.0.0-31.49
  • Date: 2013-02-20 22:17:36 UTC
  • Revision ID: package-import@ubuntu.com-20130220221736-6pfzqqi3j0tj4qjr
Tags: 3.0.0-1221.35
* Release Tracking Bug
  - LP: #1130473

[ Paolo Pisati ]

* rebased on Ubuntu-3.0.0-31.49

[ Ubuntu: 3.0.0-31.49 ]

* Release Tracking Bug
  - LP: #1130243
* ptrace: introduce signal_wake_up_state() and ptrace_signal_wake_up()
  - LP: #1129192
  - CVE-2013-0871
* ptrace: ensure arch_ptrace/ptrace_request can never race with SIGKILL
  - LP: #1129192
  - CVE-2013-0871
* wake_up_process() should be never used to wakeup a TASK_STOPPED/TRACED
  task
  - LP: #1129192
  - CVE-2013-0871

Show diffs side-by-side

added added

removed removed

Lines of Context:
631
631
 * No need to set need_resched since signal event passing
632
632
 * goes through ->blocked
633
633
 */
634
 
void signal_wake_up(struct task_struct *t, int resume)
 
634
void signal_wake_up_state(struct task_struct *t, unsigned int state)
635
635
{
636
 
        unsigned int mask;
637
 
 
638
636
        set_tsk_thread_flag(t, TIF_SIGPENDING);
639
 
 
640
637
        /*
641
 
         * For SIGKILL, we want to wake it up in the stopped/traced/killable
 
638
         * TASK_WAKEKILL also means wake it up in the stopped/traced/killable
642
639
         * case. We don't check t->state here because there is a race with it
643
640
         * executing another processor and just now entering stopped state.
644
641
         * By using wake_up_state, we ensure the process will wake up and
645
642
         * handle its death signal.
646
643
         */
647
 
        mask = TASK_INTERRUPTIBLE;
648
 
        if (resume)
649
 
                mask |= TASK_WAKEKILL;
650
 
        if (!wake_up_state(t, mask))
 
644
        if (!wake_up_state(t, state | TASK_INTERRUPTIBLE))
651
645
                kick_process(t);
652
646
}
653
647
 
1675
1669
         * If SIGKILL was already sent before the caller unlocked
1676
1670
         * ->siglock we must see ->core_state != NULL. Otherwise it
1677
1671
         * is safe to enter schedule().
 
1672
         *
 
1673
         * This is almost outdated, a task with the pending SIGKILL can't
 
1674
         * block in TASK_TRACED. But PTRACE_EVENT_EXIT can be reported
 
1675
         * after SIGKILL was already dequeued.
1678
1676
         */
1679
1677
        if (unlikely(current->mm->core_state) &&
1680
1678
            unlikely(current->mm == current->parent->mm))
1806
1804
                if (gstop_done)
1807
1805
                        do_notify_parent_cldstop(current, false, why);
1808
1806
 
 
1807
                /* tasklist protects us from ptrace_freeze_traced() */
1809
1808
                __set_current_state(TASK_RUNNING);
1810
1809
                if (clear_code)
1811
1810
                        current->exit_code = 0;