1. 24 5月, 2007 1 次提交
    • R
      recalc_sigpending_tsk fixes · 7bb44ade
      Roland McGrath 提交于
      Steve Hawkes discovered a problem where recalc_sigpending_tsk was called in
      do_sigaction but no signal_wake_up call was made, preventing later signals
      from waking up blocked threads with TIF_SIGPENDING already set.
      
      In fact, the few other calls to recalc_sigpending_tsk outside the signals
      code are also subject to this problem in other race conditions.
      
      This change makes recalc_sigpending_tsk private to the signals code.  It
      changes the outside calls, as well as do_sigaction, to use the new
      recalc_sigpending_and_wake instead.
      Signed-off-by: NRoland McGrath <roland@redhat.com>
      Cc: <Steve.Hawkes@motorola.com>
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7bb44ade
  2. 11 5月, 2007 2 次提交
    • D
      signal/timer/event: signalfd core · fba2afaa
      Davide Libenzi 提交于
      This patch series implements the new signalfd() system call.
      
      I took part of the original Linus code (and you know how badly it can be
      broken :), and I added even more breakage ;) Signals are fetched from the same
      signal queue used by the process, so signalfd will compete with standard
      kernel delivery in dequeue_signal().  If you want to reliably fetch signals on
      the signalfd file, you need to block them with sigprocmask(SIG_BLOCK).  This
      seems to be working fine on my Dual Opteron machine.  I made a quick test
      program for it:
      
      http://www.xmailserver.org/signafd-test.c
      
      The signalfd() system call implements signal delivery into a file descriptor
      receiver.  The signalfd file descriptor if created with the following API:
      
      int signalfd(int ufd, const sigset_t *mask, size_t masksize);
      
      The "ufd" parameter allows to change an existing signalfd sigmask, w/out going
      to close/create cycle (Linus idea).  Use "ufd" == -1 if you want a brand new
      signalfd file.
      
      The "mask" allows to specify the signal mask of signals that we are interested
      in.  The "masksize" parameter is the size of "mask".
      
      The signalfd fd supports the poll(2) and read(2) system calls.  The poll(2)
      will return POLLIN when signals are available to be dequeued.  As a direct
      consequence of supporting the Linux poll subsystem, the signalfd fd can use
      used together with epoll(2) too.
      
      The read(2) system call will return a "struct signalfd_siginfo" structure in
      the userspace supplied buffer.  The return value is the number of bytes copied
      in the supplied buffer, or -1 in case of error.  The read(2) call can also
      return 0, in case the sighand structure to which the signalfd was attached,
      has been orphaned.  The O_NONBLOCK flag is also supported, and read(2) will
      return -EAGAIN in case no signal is available.
      
      If the size of the buffer passed to read(2) is lower than sizeof(struct
      signalfd_siginfo), -EINVAL is returned.  A read from the signalfd can also
      return -ERESTARTSYS in case a signal hits the process.  The format of the
      struct signalfd_siginfo is, and the valid fields depends of the (->code &
      __SI_MASK) value, in the same way a struct siginfo would:
      
      struct signalfd_siginfo {
      	__u32 signo;	/* si_signo */
      	__s32 err;	/* si_errno */
      	__s32 code;	/* si_code */
      	__u32 pid;	/* si_pid */
      	__u32 uid;	/* si_uid */
      	__s32 fd;	/* si_fd */
      	__u32 tid;	/* si_fd */
      	__u32 band;	/* si_band */
      	__u32 overrun;	/* si_overrun */
      	__u32 trapno;	/* si_trapno */
      	__s32 status;	/* si_status */
      	__s32 svint;	/* si_int */
      	__u64 svptr;	/* si_ptr */
      	__u64 utime;	/* si_utime */
      	__u64 stime;	/* si_stime */
      	__u64 addr;	/* si_addr */
      };
      
      [akpm@linux-foundation.org: fix signalfd_copyinfo() on i386]
      Signed-off-by: NDavide Libenzi <davidel@xmailserver.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      fba2afaa
    • A
      [PATCH] audit signal recipients · e54dc243
      Amy Griffis 提交于
      When auditing syscalls that send signals, log the pid and security
      context for each target process. Optimize the data collection by
      adding a counter for signal-related rules, and avoiding allocating an
      aux struct unless we have more than one target process. For process
      groups, collect pid/context data in blocks of 16. Move the
      audit_signal_info() hook up in check_kill_permission() so we audit
      attempts where permission is denied.
      Signed-off-by: NAmy Griffis <amy.griffis@hp.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      e54dc243
  3. 10 5月, 2007 3 次提交
  4. 09 5月, 2007 1 次提交
  5. 08 5月, 2007 1 次提交
  6. 17 2月, 2007 2 次提交
  7. 13 2月, 2007 3 次提交
  8. 12 2月, 2007 2 次提交
  9. 14 12月, 2006 1 次提交
    • R
      [PATCH] PM: Fix freezing of stopped tasks · 3df494a3
      Rafael J. Wysocki 提交于
      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: NRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      3df494a3
  10. 09 12月, 2006 2 次提交
  11. 08 12月, 2006 3 次提交
  12. 05 11月, 2006 1 次提交
    • L
      Make sure "user->sigpending" count is in sync · 10b1fbdb
      Linus Torvalds 提交于
      The previous commit (45c18b0b, 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: NOleg Nesterov <oleg@tv-sign.ru>
      Cc: Andrew Morton <akpm@osdl.org>
      Cc: Ingo Molnar <mingo@elte.hu>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      10b1fbdb
  13. 02 10月, 2006 2 次提交
  14. 30 9月, 2006 1 次提交
  15. 27 9月, 2006 1 次提交
  16. 03 8月, 2006 1 次提交
  17. 01 7月, 2006 2 次提交
  18. 27 6月, 2006 1 次提交
  19. 20 6月, 2006 1 次提交
  20. 14 4月, 2006 1 次提交
  21. 11 4月, 2006 1 次提交
  22. 02 4月, 2006 1 次提交
  23. 01 4月, 2006 1 次提交
  24. 29 3月, 2006 5 次提交