1. 05 4月, 2011 2 次提交
  2. 29 3月, 2011 1 次提交
    • R
      Relax si_code check in rt_sigqueueinfo and rt_tgsigqueueinfo · 243b422a
      Roland Dreier 提交于
      Commit da48524e ("Prevent rt_sigqueueinfo and rt_tgsigqueueinfo
      from spoofing the signal code") made the check on si_code too strict.
      There are several legitimate places where glibc wants to queue a
      negative si_code different from SI_QUEUE:
      
       - This was first noticed with glibc's aio implementation, which wants
         to queue a signal with si_code SI_ASYNCIO; the current kernel
         causes glibc's tst-aio4 test to fail because rt_sigqueueinfo()
         fails with EPERM.
      
       - Further examination of the glibc source shows that getaddrinfo_a()
         wants to use SI_ASYNCNL (which the kernel does not even define).
         The timer_create() fallback code wants to queue signals with SI_TIMER.
      
      As suggested by Oleg Nesterov <oleg@redhat.com>, loosen the check to
      forbid only the problematic SI_TKILL case.
      Reported-by: NKlaus Dittrich <kladit@arcor.de>
      Acked-by: NJulien Tinnes <jln@google.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NRoland Dreier <roland@purestorage.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      243b422a
  3. 24 3月, 2011 1 次提交
  4. 22 3月, 2011 1 次提交
    • J
      Prevent rt_sigqueueinfo and rt_tgsigqueueinfo from spoofing the signal code · da48524e
      Julien Tinnes 提交于
      Userland should be able to trust the pid and uid of the sender of a
      signal if the si_code is SI_TKILL.
      
      Unfortunately, the kernel has historically allowed sigqueueinfo() to
      send any si_code at all (as long as it was negative - to distinguish it
      from kernel-generated signals like SIGILL etc), so it could spoof a
      SI_TKILL with incorrect siginfo values.
      
      Happily, it looks like glibc has always set si_code to the appropriate
      SI_QUEUE, so there are probably no actual user code that ever uses
      anything but the appropriate SI_QUEUE flag.
      
      So just tighten the check for si_code (we used to allow any negative
      value), and add a (one-time) warning in case there are binaries out
      there that might depend on using other si_code values.
      Signed-off-by: NJulien Tinnes <jln@google.com>
      Acked-by: NOleg Nesterov <oleg@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      da48524e
  5. 28 10月, 2010 2 次提交
  6. 07 10月, 2010 1 次提交
    • A
      HWPOISON: Copy si_addr_lsb to user · a337fdac
      Andi Kleen 提交于
      The original hwpoison code added a new siginfo field si_addr_lsb to
      pass the granuality of the fault address to user space. Unfortunately
      this field was never copied to user space. Fix this here.
      
      I added explicit checks for the MCEERR codes to avoid having
      to patch all potential callers to initialize the field.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      a337fdac
  7. 05 8月, 2010 1 次提交
  8. 28 5月, 2010 2 次提交
  9. 21 5月, 2010 1 次提交
  10. 07 3月, 2010 1 次提交
  11. 04 3月, 2010 1 次提交
    • L
      Prioritize synchronous signals over 'normal' signals · a27341cd
      Linus Torvalds 提交于
      This makes sure that we pick the synchronous signals caused by a
      processor fault over any pending regular asynchronous signals sent to
      use by [t]kill().
      
      This is not strictly required semantics, but it makes it _much_ easier
      for programs like Wine that expect to find the fault information in the
      signal stack.
      
      Without this, if a non-synchronous signal gets picked first, the delayed
      asynchronous signal will have its signal context pointing to the new
      signal invocation, rather than the instruction that caused the SIGSEGV
      or SIGBUS in the first place.
      
      This is not all that pretty, and we're discussing making the synchronous
      signals more explicit rather than have these kinds of implicit
      preferences of SIGSEGV and friends.  See for example
      
      	http://bugzilla.kernel.org/show_bug.cgi?id=15395
      
      for some of the discussion.  But in the meantime this is a simple and
      fairly straightforward work-around, and the whole
      
      	if (x & Y)
      		x &= Y;
      
      thing can be compiled into (and gcc does do it) just three instructions:
      
      	movq    %rdx, %rax
      	andl    $Y, %eax
      	cmovne  %rax, %rdx
      
      so it is at least a simple solution to a subtle issue.
      Reported-and-tested-by: NPavel Vilim <wylda@volny.cz>
      Acked-by: NOleg Nesterov <oleg@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a27341cd
  12. 12 1月, 2010 1 次提交
    • A
      kernel/signal.c: fix kernel information leak with print-fatal-signals=1 · b45c6e76
      Andi Kleen 提交于
      When print-fatal-signals is enabled it's possible to dump any memory
      reachable by the kernel to the log by simply jumping to that address from
      user space.
      
      Or crash the system if there's some hardware with read side effects.
      
      The fatal signals handler will dump 16 bytes at the execution address,
      which is fully controlled by ring 3.
      
      In addition when something jumps to a unmapped address there will be up to
      16 additional useless page faults, which might be potentially slow (and at
      least is not very efficient)
      
      Fortunately this option is off by default and only there on i386.
      
      But fix it by checking for kernel addresses and also stopping when there's
      a page fault.
      Signed-off-by: NAndi Kleen <ak@linux.intel.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: <stable@kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b45c6e76
  13. 16 12月, 2009 5 次提交
  14. 11 12月, 2009 2 次提交
  15. 26 11月, 2009 3 次提交
  16. 09 11月, 2009 1 次提交
    • N
      signal: Print warning message when dropping signals · f84d49b2
      Naohiro Ooiwa 提交于
      When the system has too many timers or too many aggregate
      queued signals, the EAGAIN error is returned to application
      from kernel, including timer_create() [POSIX.1b].
      
      It means that the app exceeded the limit of pending signals,
      but in general application writers do not expect this
      outcome and the current silent failure can cause rare app
      failures under very high load.
      
      This patch adds a new message when we reach the limit
      and if print_fatal_signals is enabled:
      
          task/1234: reached RLIMIT_SIGPENDING, dropping signal
      
      If you see this message and your system behaved unexpectedly,
      you can run following command to lift the limit:
      
         # ulimit -i unlimited
      
      With help from Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>.
      Signed-off-by: NNaohiro Ooiwa <nooiwa@miraclelinux.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Hiroshi Shimamoto <h-shimamoto@ct.jp.nec.com>
      Cc: Roland McGrath <roland@redhat.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: oleg@redhat.com
      LKML-Reference: <4AF6E7E2.9080406@miraclelinux.com>
      [ Modified a few small details, gave surrounding code some love. ]
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      f84d49b2
  17. 24 9月, 2009 4 次提交
  18. 02 8月, 2009 2 次提交
    • L
      do_sigaltstack: small cleanups · 0dd8486b
      Linus Torvalds 提交于
      The previous commit ("do_sigaltstack: avoid copying 'stack_t' as a
      structure to user space") fixed a real bug.  This one just cleans up the
      copy from user space to that gcc can generate better code for it (and so
      that it looks the same as the later copy back to user space).
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0dd8486b
    • L
      do_sigaltstack: avoid copying 'stack_t' as a structure to user space · 0083fc2c
      Linus Torvalds 提交于
      Ulrich Drepper correctly points out that there is generally padding in
      the structure on 64-bit hosts, and that copying the structure from
      kernel to user space can leak information from the kernel stack in those
      padding bytes.
      
      Avoid the whole issue by just copying the three members one by one
      instead, which also means that the function also can avoid the need for
      a stack frame.  This also happens to match how we copy the new structure
      from user space, so it all even makes sense.
      
      [ The obvious solution of adding a memset() generates horrid code, gcc
        does really stupid things. ]
      Reported-by: NUlrich Drepper <drepper@redhat.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      0083fc2c
  19. 19 6月, 2009 2 次提交
  20. 15 6月, 2009 1 次提交
    • V
      signal: fix __send_signal() false positive kmemcheck warning · 7a0aeb14
      Vegard Nossum 提交于
      This false positive is due to field padding in struct sigqueue. When
      this dynamically allocated structure is copied to the stack (in arch-
      specific delivery code), kmemcheck sees a read from the padding, which
      is, naturally, uninitialized.
      
      Hide the false positive using the __GFP_NOTRACK_FALSE_POSITIVE flag.
      Also made the rlimit override code a bit clearer by introducing a new
      variable.
      
      Cc: Oleg Nesterov <oleg@tv-sign.ru>
      Signed-off-by: NVegard Nossum <vegard.nossum@gmail.com>
      7a0aeb14
  21. 01 5月, 2009 2 次提交
  22. 30 4月, 2009 1 次提交
  23. 15 4月, 2009 2 次提交
    • S
      tracing/events: move trace point headers into include/trace/events · ad8d75ff
      Steven Rostedt 提交于
      Impact: clean up
      
      Create a sub directory in include/trace called events to keep the
      trace point headers in their own separate directory. Only headers that
      declare trace points should be defined in this directory.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Cc: Zhao Lei <zhaolei@cn.fujitsu.com>
      Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
      Cc: Pekka Enberg <penberg@cs.helsinki.fi>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      ad8d75ff
    • S
      tracing: create automated trace defines · a8d154b0
      Steven Rostedt 提交于
      This patch lowers the number of places a developer must modify to add
      new tracepoints. The current method to add a new tracepoint
      into an existing system is to write the trace point macro in the
      trace header with one of the macros TRACE_EVENT, TRACE_FORMAT or
      DECLARE_TRACE, then they must add the same named item into the C file
      with the macro DEFINE_TRACE(name) and then add the trace point.
      
      This change cuts out the needing to add the DEFINE_TRACE(name).
      Every file that uses the tracepoint must still include the trace/<type>.h
      file, but the one C file must also add a define before the including
      of that file.
      
       #define CREATE_TRACE_POINTS
       #include <trace/mytrace.h>
      
      This will cause the trace/mytrace.h file to also produce the C code
      necessary to implement the trace point.
      
      Note, if more than one trace/<type>.h is used to create the C code
      it is best to list them all together.
      
       #define CREATE_TRACE_POINTS
       #include <trace/foo.h>
       #include <trace/bar.h>
       #include <trace/fido.h>
      
      Thanks to Mathieu Desnoyers and Christoph Hellwig for coming up with
      the cleaner solution of the define above the includes over my first
      design to have the C code include a "special" header.
      
      This patch converts sched, irq and lockdep and skb to use this new
      method.
      
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Neil Horman <nhorman@tuxdriver.com>
      Cc: Zhao Lei <zhaolei@cn.fujitsu.com>
      Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro>
      Cc: Pekka Enberg <penberg@cs.helsinki.fi>
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      a8d154b0