27 Feb, 2007

1 commit

  • * master.kernel.org:/pub/scm/linux/kernel/git/kyle/parisc-2.6: (78 commits)
    [PARISC] Use symbolic last syscall in __NR_Linux_syscalls
    [PARISC] Add missing statfs64 and fstatfs64 syscalls
    Revert "[PARISC] Optimize TLB flush on SMP systems"
    [PARISC] Compat signal fixes for 64-bit parisc
    [PARISC] Reorder syscalls to match unistd.h
    Revert "[PATCH] make kernel/signal.c:kill_proc_info() static"
    [PARISC] fix sys_rt_sigqueueinfo
    [PARISC] fix section mismatch warnings in harmony sound driver
    [PARISC] do not export get_register/set_register
    [PARISC] add ENTRY()/ENDPROC() and simplify assembly of HP/UX emulation code
    [PARISC] convert to use CONFIG_64BIT instead of __LP64__
    [PARISC] use CONFIG_64BIT instead of __LP64__
    [PARISC] add ASM_EXCEPTIONTABLE_ENTRY() macro
    [PARISC] more ENTRY(), ENDPROC(), END() conversions
    [PARISC] fix ENTRY() and ENDPROC() for 64bit-parisc
    [PARISC] Fixes /proc/cpuinfo cache output on B160L
    [PARISC] implement standard ENTRY(), END() and ENDPROC()
    [PARISC] kill ENTRY_SYS_CPUS
    [PARISC] clean up debugging printks in smp.c
    [PARISC] factor syscall_restart code out of do_signal
    ...

    Fix conflict in include/linux/sched.h due to kill_proc_info() being made
    publicly available to PARISC again.

    Linus Torvalds
     

17 Feb, 2007

2 commits


13 Feb, 2007

3 commits

  • Now that I have changed all of the in-tree users remove the old version of
    these functions. This should make it clear to any out of tree users that they
    should be using kill_pgrp kill_pgrp_info or __kill_pgrp_info instead.

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

    Eric W. Biederman
     
  • Every call to is_orphaned_pgrp passed in process_group(current) which is racy
    with respect to another thread changing our process group. It didn't bite us
    because we were dealing with integers and the worse we would get would be a
    stale answer.

    In switching the checks to use struct pid to be a little more efficient and
    prepare the way for pid namespaces this race became apparent.

    So I simplified the calls to the more specialized is_current_pgrp_orphaned so
    I didn't have to worry about making logic changes to avoid the race.

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

    Eric W. Biederman
     
  • The goal is to remove users of the old signal helper functions so they can be
    removed.

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

    Eric W. Biederman
     

12 Feb, 2007

2 commits


14 Dec, 2006

1 commit

  • Currently, if a task is stopped (ie. it's in the TASK_STOPPED state), it
    is considered by the freezer as unfreezeable. However, there may be a race
    between the freezer and the delivery of the continuation signal to the task
    resulting in the task running after we have finished freezing the other
    tasks. This, in turn, may lead to undesirable effects up to and including
    data corruption.

    To prevent this from happening we first need to make the freezer consider
    stopped tasks as freezeable. For this purpose we need to make freezeable()
    stop returning 0 for these tasks and we need to force them to enter the
    refrigerator. However, if there's no continuation signal in the meantime,
    the stopped tasks should remain stopped after all processes have been
    thawed, so we need to send an additional SIGSTOP to each of them before
    waking it up.

    Also, a stopped task that has just been woken up should first check if
    there's a freezing request for it and go to the refrigerator if that's the
    case.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Rafael J. Wysocki
     

09 Dec, 2006

2 commits

  • Add a per pid_namespace child-reaper. This is needed so processes are reaped
    within the same pid space and do not spill over to the parent pid space. Its
    also needed so containers preserve existing semantic that pid == 1 would reap
    orphaned children.

    This is based on Eric Biederman's patch: http://lkml.org/lkml/2006/2/6/285

    Signed-off-by: Sukadev Bhattiprolu
    Signed-off-by: Cedric Le Goater
    Cc: Kirill Korotaev
    Cc: Eric W. Biederman
    Cc: Herbert Poetzl
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sukadev Bhattiprolu
     
  • Replace occurences of task->signal->session by a new process_session() helper
    routine.

    It will be useful for pid namespaces to abstract the session pid number.

    Signed-off-by: Cedric Le Goater
    Cc: Kirill Korotaev
    Cc: Eric W. Biederman
    Cc: Herbert Poetzl
    Cc: Sukadev Bhattiprolu
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Cedric Le Goater
     

08 Dec, 2006

3 commits

  • Signed-off-by: Adrian Bunk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     
  • Move process freezing functions from include/linux/sched.h to freezer.h, so
    that modifications to the freezer or the kernel configuration don't require
    recompiling just about everything.

    [akpm@osdl.org: fix ueagle driver]
    Signed-off-by: Nigel Cunningham
    Cc: "Rafael J. Wysocki"
    Cc: Pavel Machek
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nigel Cunningham
     
  • Replace all uses of kmem_cache_t with struct kmem_cache.

    The patch was generated using the following script:

    #!/bin/sh
    #
    # Replace one string by another in all the kernel sources.
    #

    set -e

    for file in `find * -name "*.c" -o -name "*.h"|xargs grep -l $1`; do
    quilt add $file
    sed -e "1,\$s/$1/$2/g" $file >/tmp/$$
    mv /tmp/$$ $file
    quilt refresh
    done

    The script was run like this

    sh replace kmem_cache_t "struct kmem_cache"

    Signed-off-by: Christoph Lameter
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Christoph Lameter
     

05 Nov, 2006

1 commit

  • The previous commit (45c18b0bb579b5c1b89f8c99f1b6ffa4c586ba08, aka "Fix
    unlikely (but possible) race condition on task->user access") fixed a
    potential oops due to __sigqueue_alloc() getting its "user" pointer out
    of sync with switch_user(), and accessing a user pointer that had been
    de-allocated on another CPU.

    It still left another (much less serious) problem, where a concurrent
    __sigqueue_alloc and swich_user could cause sigqueue_alloc to do signal
    pending reference counting for a _different_ user than the one it then
    actually ended up using. No oops, but we'd end up with the wrong signal
    accounting.

    Another case of Oleg's eagle-eyes picking up the problem.

    This is trivially fixed by just making sure we load whichever "user"
    structure we decide to use (it doesn't matter _which_ one we pick, we
    just need to pick one) just once.

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

    Linus Torvalds
     

02 Oct, 2006

2 commits

  • The problem with remembering a user space process by its pid is that it is
    possible that the process will exit, pid wrap around will occur.
    Converting to a struct pid avoid that problem, and paves the way for
    implementing a pid namespace.

    Also since usb is the only user of kill_proc_info_as_uid rename
    kill_proc_info_as_uid to kill_pid_info_as_uid and have the new version take
    a struct pid.

    Signed-off-by: Eric W. Biederman
    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric W. Biederman
     
  • Currently the signal functions all either take a task or a pid_t argument.
    This patch implements variants that take a struct pid *. After all of the
    users have been update it is my intention to remove the variants that take a
    pid_t as using pid_t can be more work (an extra hash table lookup) and
    difficult to get right in the presence of multiple pid namespaces.

    There are two kinds of functions introduced in this patch. The are the
    general use functions kill_pgrp and kill_pid which take a priv argument that
    is ultimately used to create the appropriate siginfo information, Then there
    are _kill_pgrp_info, kill_pgrp_info, kill_pid_info the internal implementation
    helpers that take an explicit siginfo.

    The distinction is made because filling out an explcit siginfo is tricky, and
    will be even more tricky when pid namespaces are introduced.

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

    Eric W. Biederman
     

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

11 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