Showing error 1170

User: Jiri Slaby
Error type: Double Unlock
Error type description: Some lock is unlocked twice unintentionally in a sequence
File location: kernel/signal.c
Line in file: 1551
Project: Linux Kernel
Project version: 2.6.28
Tools: Stanse (1.2)
Entered: 2012-04-30 10:52:00 UTC


Source:

1521                /*
1522                 * The arch code has something special to do before a
1523                 * ptrace stop.  This is allowed to block, e.g. for faults
1524                 * on user stack pages.  We can't keep the siglock while
1525                 * calling arch_ptrace_stop, so we must release it now.
1526                 * To preserve proper semantics, we must do this before
1527                 * any signal bookkeeping like checking group_stop_count.
1528                 * Meanwhile, a SIGKILL could come in before we retake the
1529                 * siglock.  That must prevent us from sleeping in TASK_TRACED.
1530                 * So after regaining the lock, we must check for SIGKILL.
1531                 */
1532                spin_unlock_irq(&current->sighand->siglock);
1533                arch_ptrace_stop(exit_code, info);
1534                spin_lock_irq(&current->sighand->siglock);
1535                if (sigkill_pending(current))
1536                        return;
1537        }
1538
1539        /*
1540         * If there is a group stop in progress,
1541         * we must participate in the bookkeeping.
1542         */
1543        if (current->signal->group_stop_count > 0)
1544                --current->signal->group_stop_count;
1545
1546        current->last_siginfo = info;
1547        current->exit_code = exit_code;
1548
1549        /* Let the debugger run.  */
1550        __set_current_state(TASK_TRACED);
1551        spin_unlock_irq(&current->sighand->siglock);
1552        read_lock(&tasklist_lock);
1553        if (may_ptrace_stop()) {
1554                do_notify_parent_cldstop(current, CLD_TRAPPED);
1555                read_unlock(&tasklist_lock);
1556                schedule();
1557        } else {
1558                /*
1559                 * By the time we got the lock, our tracer went away.
1560                 * Don't drop the lock yet, another tracer may come.
1561                 */
Show full sources