30 Sep, 2006

1 commit

  • This tightens up __dequeue_signal a little. It also avoids doing
    recalc_sigpending twice in a row, instead doing it once in dequeue_signal.

    Signed-off-by: Roland McGrath
    Cc: Oleg Nesterov
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Roland McGrath
     

27 Sep, 2006

1 commit

  • Move the fallback arch_vma_name() to a sensible place (kernel/signal.c).

    Currently it's in fs/proc/task_mmu.c, a file that is dependent on both
    CONFIG_PROC_FS and CONFIG_MMU being enabled, but it's used from
    kernel/signal.c from where it is called unconditionally.

    [akpm@osdl.org: build fix]
    Signed-off-by: David Howells
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Howells
     

03 Aug, 2006

1 commit

  • Suresh points out that commit b0423a0d9cc836b2c3d796623cd19236bfedfe63
    broke the semantics of a synchronous signal like SIGSEGV occurring
    recursively inside its own handler handler (or, indeed, any other
    context when the signal was blocked).

    That was unintentional, and this fixes things up by reinstating the old
    semantics, but without reverting the cleanups.

    Cc: Paul E. McKenney
    Acked-by: Suresh Siddha
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

01 Jul, 2006

3 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/bunk/trivial:
    Remove obsolete #include
    remove obsolete swsusp_encrypt
    arch/arm26/Kconfig typos
    Documentation/IPMI typos
    Kconfig: Typos in net/sched/Kconfig
    v9fs: do not include linux/version.h
    Documentation/DocBook/mtdnand.tmpl: typo fixes
    typo fixes: specfic -> specific
    typo fixes in Documentation/networking/pktgen.txt
    typo fixes: occuring -> occurring
    typo fixes: infomation -> information
    typo fixes: disadvantadge -> disadvantage
    typo fixes: aquire -> acquire
    typo fixes: mecanism -> mechanism
    typo fixes: bandwith -> bandwidth
    fix a typo in the RTC_CLASS help text
    smb is no longer maintained

    Manually merged trivial conflict in arch/um/kernel/vmlinux.lds.S

    Linus Torvalds
     
  • This patch adds a call to the extended security_task_kill hook introduced by
    the prior patch to the kill_proc_info_as_uid function so that these signals
    can be properly mediated by security modules. It also updates the existing
    hook call in check_kill_permission.

    Signed-off-by: David Quigley
    Signed-off-by: James Morris
    Cc: Stephen Smalley
    Cc: Chris Wright
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Quigley
     
  • Signed-off-by: Jörn Engel
    Signed-off-by: Adrian Bunk

    Jörn Engel
     

27 Jun, 2006

1 commit

  • With this patch zap_process() sets SIGNAL_GROUP_EXIT while sending SIGKILL to
    the thread group. This means that a TASK_TRACED task

    1. Will be awakened by signal_wake_up(1)

    2. Can't sleep again via ptrace_notify()

    3. Can't go to do_signal_stop() after return
    from ptrace_stop() in get_signal_to_deliver()

    So we can remove all ptrace related stuff from coredump path.

    Signed-off-by: Oleg Nesterov
    Cc: "Eric W. Biederman"
    Cc: Roland McGrath
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     

20 Jun, 2006

1 commit


14 Apr, 2006

1 commit

  • This reverts most of commit 30e0fca6c1d7d26f3f2daa4dd2b12c51dadc778a.
    It broke the case of non-leader MT exec when ptraced.
    I think the bug it was intended to fix was already addressed by commit
    788e05a67c343fa22f2ae1d3ca264e7f15c25eaf.

    Signed-off-by: Roland McGrath
    Acked-by: Oleg Nesterov
    Signed-off-by: Linus Torvalds

    Roland McGrath
     

11 Apr, 2006

1 commit


02 Apr, 2006

1 commit


01 Apr, 2006

1 commit

  • strace /bin/bash misbehaves after resume; this fixes it.

    (akpm: it's scary calling refrigerator() in state TASK_TRACED, but it seems to
    do the right thing).

    Signed-off-by: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Pavel Machek
     

29 Mar, 2006

16 commits

  • send_sigqueue() checks PF_EXITING, then locks p->sighand->siglock. This is
    unsafe: 'p' can exit in between and set ->sighand = NULL. The race is
    theoretical, the window is tiny and irqs are disabled by the caller, so I
    don't think we need the fix for -stable tree.

    Convert send_sigqueue() to use lock_task_sighand() helper.

    Also, delete 'p->flags & PF_EXITING' re-check, it is unneeded and the
    comment is wrong.

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • The previous patch has changed callsites of do_notify_parent_cldstop() so that
    to_self == (->ptrace & PT_PTRACED) always (as it should be). We can remove
    this parameter now.

    Signed-off-by: Oleg Nesterov
    Cc: john stultz
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Remove an obscure 'stop_count < 0' check in finish_stop(). The previous patch
    made this case impossible.

    Signed-off-by: Oleg Nesterov
    Cc: john stultz
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • do_signal_stop() considers 'thread_group_empty()' as a special case.
    This was needed to avoid taking tasklist_lock. Since this lock is
    unneeded any longer, we can remove this special case and simplify
    the code even more.

    Also, before this patch, finish_stop() was called with stop_count == -1
    for 'thread_group_empty()' case. This is not strictly wrong, but confusing
    and unneeded.

    Signed-off-by: Oleg Nesterov
    Cc: john stultz
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • do_sigaction() does not need tasklist_lock anymore, we can simplify the code.

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • do_signal_stop() does not need tasklist_lock anymore. So it does not need to
    do misc re-checks, and we can simplify the code.

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • handle_stop_signal() does not need tasklist_lock for SIG_KERNEL_STOP_MASK
    signals anymore.

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • __exit_signal() is private to release_task() now. I think it is better to
    make it static in kernel/exit.c and export flush_sigqueue() instead - this
    function is much more simple and straightforward.

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Cosmetic, rename __exit_sighand to cleanup_sighand and move it close to
    copy_sighand().

    This matches copy_signal/cleanup_signal naming, and I think it is easier to
    follow.

    Signed-off-by: Oleg Nesterov
    Cc: "Eric W. Biederman"
    Acked-by: "Paul E. McKenney"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • This patch factors out duplicated code under 'if' branches. Also, BUG_ON()
    conversions and whitespace cleanups.

    Signed-off-by: Oleg Nesterov
    Cc: "Eric W. Biederman"
    Acked-by: "Paul E. McKenney"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • __exit_signal() does important cleanups atomically under ->siglock. It is
    also called from copy_process's error path. This is not good, for example we
    can't move __unhash_process() under ->siglock for that reason.

    We should not mix these 2 paths, just look at ugly 'if (p->sighand)' under
    'bad_fork_cleanup_sighand:' label. For copy_process() case it is sufficient
    to just backout copy_signal(), nothing more.

    Again, nobody can see this task yet. For CLONE_THREAD case we just decrement
    signal->count, otherwise nobody can see this ->signal and we can free it
    lockless.

    This patch assumes it is safe to do exit_thread_group_keys() without
    tasklist_lock.

    Signed-off-by: Oleg Nesterov
    Cc: "Eric W. Biederman"
    Acked-by: David Howells
    Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • The only caller of exit_sighand(tsk) is copy_process's error path. We can
    call __exit_sighand() directly and kill exit_sighand().

    This 'tsk' was not yet registered in pid_hash[] or init_task.tasks, it has no
    external references, nobody can see it, and

    IF (clone_flags & CLONE_SIGHAND)
    At least 'current' has a reference to ->sighand, this
    means atomic_dec_and_test(sighand->count) can't be true.

    ELSE
    Nobody can see this ->sighand, this means we can free it
    without any locking.

    Signed-off-by: Oleg Nesterov
    Cc: "Eric W. Biederman"
    Acked-by: "Paul E. McKenney"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • In my opinion this patch cleans up the code.

    Signed-off-by: Oleg Nesterov
    Cc: "Eric W. Biederman"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • Add lock_task_sighand() helper and converts group_send_sig_info() to use
    it. Hopefully we will have more users soon.

    This patch also removes '!sighand->count' and '!p->usage' checks, I think
    they both are bogus, racy and unneeded (but probably it makes sense to
    restore them as BUG_ON()s).

    ->sighand is cleared and it's ->count is decremented in release_task() with
    sighand->siglock held, so it is a bug to have '!p->usage || !->count' after
    we already locked and verified it is the same. On the other hand, an
    already dead task without ->sighand can have a non-zero ->usage due to
    ptrace, for example.

    If we read the stale value of ->sighand we must see the change after
    spin_lock(), because that change was done while holding that same old
    ->sighand.siglock.

    Signed-off-by: Oleg Nesterov
    Cc: "Eric W. Biederman"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • This patch borrows a clever Hugh's 'struct anon_vma' trick.

    Without tasklist_lock held we can't trust task->sighand until we locked it
    and re-checked that it is still the same.

    But this means we don't need to defer 'kmem_cache_free(sighand)'. We can
    return the memory to slab immediately, all we need is to be sure that
    sighand->siglock can't dissapear inside rcu protected section.

    To do so we need to initialize ->siglock inside ctor function,
    SLAB_DESTROY_BY_RCU does the rest.

    Signed-off-by: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Oleg Nesterov
     
  • After looking at the problem of init calling exec some more I figured out
    an easy way to make the code work.

    The actual symptom without out this patch is that all threads will die
    except pid == 1, and the thread calling exec. The thread calling exec will
    wait forever for pid == 1 to die.

    Since pid == 1 does not install a handler for SIGKILL it will never die.

    This modifies the tests for init from current->pid == 1 to the equivalent
    current == child_reaper. And then it causes exec in the ugly case to
    modify child_reaper.

    The only weird symptom is that you wind up with an init process that
    doesn't have the oldest start time on the box.

    Signed-off-by: Eric W. Biederman
    Cc: Oleg Nesterov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     

23 Mar, 2006

2 commits


10 Feb, 2006

2 commits


04 Feb, 2006

1 commit


19 Jan, 2006

1 commit

  • The TIF_RESTORE_SIGMASK flag allows us to have a generic implementation of
    sys_rt_sigsuspend() instead of duplicating it for each architecture. This
    provides such an implementation and makes arch/powerpc use it.

    It also tidies up the ppc32 sys_sigsuspend() to use TIF_RESTORE_SIGMASK.

    Signed-off-by: David Woodhouse
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Woodhouse
     

15 Jan, 2006

1 commit


12 Jan, 2006

1 commit

  • - Move capable() from sched.h to capability.h;

    - Use where capable() is used
    (in include/, block/, ipc/, kernel/, a few drivers/,
    mm/, security/, & sound/;
    many more drivers/ to go)

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy.Dunlap
     

09 Jan, 2006

4 commits