1. 24 Jul, 2009 1 commit
  2. 16 May, 2009 1 commit
    • Linus Torvalds's avatar
      Fix caller information for warn_slowpath_null · 0f6f49a8
      Linus Torvalds authored
      Ian Campbell noticed that since "Eliminate thousands of warnings with
      gcc 3.2 build" (commit 57adc4d2
      
      ) all
      WARN_ON()'s currently appear to come from warn_slowpath_null(), eg:
      
        WARNING: at kernel/softirq.c:143 warn_slowpath_null+0x1c/0x20()
      
      because now that warn_slowpath_null() is in the call path, the
      __builtin_return_address(0) returns that, rather than the place that
      caused the warning.
      
      Fix this by splitting up the warn_slowpath_null/fmt cases differently,
      using a common helper function, and getting the return address in the
      right place.  This also happens to avoid the unnecessary stack usage for
      the non-stdargs case, and just generally cleans things up.
      
      Make the function name printout use %pS while at it.
      
      Cc: Ian Campbell <ian.campbell@citrix.com>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Arjan van de Ven <arjan@linux.intel.com>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Hugh Dickins <hugh@veritas.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      0f6f49a8
  3. 06 May, 2009 1 commit
  4. 23 Apr, 2009 1 commit
    • Ingo Molnar's avatar
      locking: clarify kernel-taint warning message · b48ccb09
      Ingo Molnar authored
      
      Andi Kleen reported this message triggering on non-lockdep kernels:
      
         Disabling lockdep due to kernel taint
      
      Clarify the message to say 'lock debugging' - debug_locks_off()
      turns off all things lock debugging, not just lockdep.
      
      [ Impact: change kernel warning message text ]
      Reported-by: default avatarAndi Kleen <andi@firstfloor.org>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      b48ccb09
  5. 12 Apr, 2009 2 commits
    • Frederic Weisbecker's avatar
      lockdep: continue lock debugging despite some taints · 574bbe78
      Frederic Weisbecker authored
      
      Impact: broaden lockdep checks
      
      Lockdep is disabled after any kernel taints. This might be convenient
      to ignore bad locking issues which sources come from outside the kernel
      tree. Nevertheless, it might be a frustrating experience for the
      staging developers or those who experience a warning but are focused
      on another things that require lockdep.
      
      The v2 of this patch simply don't disable anymore lockdep in case
      of TAINT_CRAP and TAINT_WARN events.
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: LTP <ltp-list@lists.sourceforge.net>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Greg KH <gregkh@suse.de>
      LKML-Reference: <1239412638-6739-2-git-send-email-fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      574bbe78
    • Frederic Weisbecker's avatar
      lockdep: warn about lockdep disabling after kernel taint · 9eeba613
      Frederic Weisbecker authored
      
      Impact: provide useful missing info for developers
      
      Kernel taint can occur in several situations such as warnings,
      load of prorietary or staging modules, bad page, etc...
      
      But when such taint happens, a developer might still be working on
      the kernel, expecting that lockdep is still enabled. But a taint
      disables lockdep without ever warning about it.
      Such a kernel behaviour doesn't really help for kernel development.
      
      This patch adds this missing warning.
      
      Since the taint is done most of the time after the main message that
      explain the real source issue, it seems safe to warn about it inside
      add_taint() so that it appears at last, without hurting the main
      information.
      
      v2: Use a generic helper to disable lockdep instead of an
          open coded xchg().
      Signed-off-by: default avatarFrederic Weisbecker <fweisbec@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      LKML-Reference: <1239412638-6739-1-git-send-email-fweisbec@gmail.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      9eeba613
  6. 13 Mar, 2009 3 commits
    • Ingo Molnar's avatar
      panic: clean up kernel/panic.c · c95dbf27
      Ingo Molnar authored
      
      Impact: cleanup, no code changed
      
      Clean up kernel/panic.c some more and make it more consistent.
      
      LKML-Reference: <49B91A7E.76E4.0078.0@novell.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      c95dbf27
    • Ingo Molnar's avatar
      panic, smp: provide smp_send_stop() wrapper on UP too · d1dedb52
      Ingo Molnar authored
      
      Impact: cleanup, no code changed
      
      Remove an ugly #ifdef CONFIG_SMP from panic(), by providing
      an smp_send_stop() wrapper on UP too.
      
      LKML-Reference: <49B91A7E.76E4.0078.0@novell.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      d1dedb52
    • Ingo Molnar's avatar
      panic: decrease oops_in_progress only after having done the panic · ffd71da4
      Ingo Molnar authored
      
      Impact: eliminate secondary warnings during panic()
      
      We can panic() in a number of difficult, atomic contexts, hence
      we use bust_spinlocks(1) in panic() to increase oops_in_progress,
      which prevents various debug checks we have in place.
      
      But in practice this protection only covers the first few printk's
      done by panic() - it does not cover the later attempt to stop all
      other CPUs and kexec(). If a secondary warning triggers in one of
      those facilities that can make the panic message scroll off.
      
      So do bust_spinlocks(0) only much later in panic(). (which code
      is only reached if panic policy is relaxed that it can return
      after a warning message)
      Reported-by: default avatarJan Beulich <jbeulich@novell.com>
      LKML-Reference: <49B91A7E.76E4.0078.0@novell.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      ffd71da4
  7. 09 Feb, 2009 1 commit
    • Tejun Heo's avatar
      stackprotector: update make rules · 5d707e9c
      Tejun Heo authored
      
      Impact: no default -fno-stack-protector if stackp is enabled, cleanup
      
      Stackprotector make rules had the following problems.
      
      * cc support test and warning are scattered across makefile and
        kernel/panic.c.
      
      * -fno-stack-protector was always added regardless of configuration.
      
      Update such that cc support test and warning are contained in makefile
      and -fno-stack-protector is added iff stackp is turned off.  While at
      it, prepare for 32bit support.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      5d707e9c
  8. 06 Jan, 2009 1 commit
  9. 02 Dec, 2008 1 commit
  10. 28 Nov, 2008 3 commits
  11. 21 Oct, 2008 1 commit
  12. 16 Oct, 2008 2 commits
  13. 10 Oct, 2008 1 commit
    • Greg Kroah-Hartman's avatar
      Staging: add TAINT_CRAP for all drivers/staging code · 061b1bd3
      Greg Kroah-Hartman authored
      
      We need to add a flag for all code that is in the drivers/staging/
      directory to prevent all other kernel developers from worrying about
      issues here, and to notify users that the drivers might not be as good
      as they are normally used to.
      
      Based on code from Andreas Gruenbacher and Jeff Mahoney to provide a
      TAINT flag for the support level of a kernel module in the Novell
      enterprise kernel release.
      
      This is the kernel portion of this feature, the ability for the flag to
      be set needs to be done in the build process and will happen in a
      follow-up patch.
      
      Cc: Andreas Gruenbacher <agruen@suse.de>
      Cc: Jeff Mahoney <jeffm@suse.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      061b1bd3
  14. 25 Jul, 2008 1 commit
  15. 13 Jul, 2008 2 commits
    • Ingo Molnar's avatar
      stackprotector: remove self-test · 4f962d4d
      Ingo Molnar authored
      
      turns out gcc generates such stackprotector-failure sequences
      in certain circumstances:
      
              movq    -8(%rbp), %rax  # D.16032,
              xorq    %gs:40, %rax    #,
              jne     .L17    #,
              leave
              ret
      .L17:
              call    __stack_chk_fail        #
              .size   __stack_chk_test_func, .-__stack_chk_test_func
              .section        .init.text,"ax",@progbits
              .type   panic_setup, @function
      panic_setup:
              pushq   %rbp    #
      
      note that there's no jump back to the failing context after the
      call to __stack_chk_fail - i.e. it has a ((noreturn)) attribute.
      
      Which is fair enough in the normal case but kills the self-test.
      (as we cannot reliably return in the self-test)
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      4f962d4d
    • Arjan van de Ven's avatar
      x86: simplify stackprotector self-check · af9ff786
      Arjan van de Ven authored
      
      Clean up the code by removing no longer needed code;
      make sure the pda is updated and kept in sync
      Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      af9ff786
  16. 11 Jul, 2008 1 commit
  17. 26 May, 2008 5 commits
  18. 29 Apr, 2008 1 commit
    • Nur Hussein's avatar
      Taint kernel after WARN_ON(condition) · 95b570c9
      Nur Hussein authored
      
      The kernel is sent to tainted within the warn_on_slowpath() function, and
      whenever a warning occurs the new taint flag 'W' is set.  This is useful to
      know if a warning occurred before a BUG by preserving the warning as a flag
      in the taint state.
      
      This does not work on architectures where WARN_ON has its own definition.
      These archs are:
      	1. s390
      	2. superh
      	3. avr32
      	4. parisc
      
      The maintainers of these architectures have been added in the Cc: list
      in this email to alert them to the situation.
      
      The documentation in oops-tracing.txt has been updated to include the
      new flag.
      Signed-off-by: default avatarNur Hussein <nurhussein@gmail.com>
      Cc: Arjan van de Ven <arjan@infradead.org>
      Cc: "Randy.Dunlap" <rdunlap@xenotime.net>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Kyle McMartin <kyle@mcmartin.ca>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      95b570c9
  19. 07 Feb, 2008 1 commit
  20. 30 Jan, 2008 2 commits
    • Arjan van de Ven's avatar
      debug: add the end-of-trace marker and the module list to · 71c33911
      Arjan van de Ven authored
      
      Unlike oopses, WARN_ON() currently does't print the loaded modules list.
      This makes it harder to take action on certain bug reports. For example,
      recently there were a set of WARN_ON()s reported in the mac80211 stack,
      which were just signalling a driver bug. It takes then anther round trip
      to the bug reporter (if he responds at all) to find out which driver
      is at fault.
      
      Another issue is that, unlike oopses, WARN_ON() doesn't currently printk
      the helpful "cut here" line, nor the "end of trace" marker.
      Now that WARN_ON() is out of line, the size increase due to this is
      minimal and it's worth adding.
      Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      71c33911
    • Arjan van de Ven's avatar
      debug: move WARN_ON() out of line · 79b4cc5e
      Arjan van de Ven authored
      
      A quick grep shows that there are currently 1145 instances of WARN_ON
      in the kernel. Currently, WARN_ON is pretty much entirely inlined,
      which makes it hard to enhance it without growing the size of the kernel
      (and getting Andrew unhappy).
      
      This patch build on top of Olof's patch that introduces __WARN,
      and places the slowpath out of line. It also uses Ingo's suggestion
      to not use __FUNCTION__ but to use kallsyms to do the lookup;
      this saves a ton of extra space since gcc doesn't need to store the function
      string twice now:
      
      3936367  833603  624736 5394706  525112 vmlinux.before
      3917508  833603  624736 5375847  520767 vmlinux-slowpath
      
      15Kb savings...
      Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      CC: Andrew Morton <akpm@linux-foundation.org>
      CC: Olof Johansson <olof@lixom.net>
      Acked-by: default avatarMatt Meckall <mpm@selenic.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      79b4cc5e
  21. 20 Dec, 2007 1 commit
    • Arjan van de Ven's avatar
      debug: add end-of-oops marker · 2c3b20e9
      Arjan van de Ven authored
      
      Right now it's nearly impossible for parsers that collect kernel crashes
      from logs or emails (such as www.kerneloops.org) to detect the
      end-of-oops condition. In addition, it's not currently possible to
      detect whether or not 2 oopses that look alike are actually the same
      oops reported twice, or are truly two unique oopses.
      
      This patch adds an end-of-oops marker, and makes the end marker include
      a very simple 64-bit random ID to be able to detect duplicate reports.
      
      Normally, this ID is calculated as a late_initcall() (in the hope that
      at that time there is enough entropy to get a unique enough ID); however
      for early oopses the oops_exit() function needs to generate the ID on
      the fly.
      
      We do this all at the _end_ of an oops printout, so this does not impact
      our ability to get the most important portions of a crash out to the
      console first.
      
      [ Sidenote: the already existing oopses-since-bootup counter we print
        during crashes serves as the differentiator between multiple oopses
        that trigger during the same bootup. ]
      
      Tested on 32-bit and 64-bit x86. Artificially injected very early
      crashes as well, as expected they result in this constant ID after
      multiple bootups:
      
        ---[ end trace ca143223eefdc828 ]---
        ---[ end trace ca143223eefdc828 ]---
      
      because the random pools are still all zero. But it all still works
      fine and causes no additional problems (which is the main goal of
      instrumentation code).
      Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      2c3b20e9
  22. 19 Oct, 2007 1 commit
  23. 18 Oct, 2007 1 commit
  24. 17 Jul, 2007 1 commit
  25. 11 Feb, 2007 1 commit
    • Theodore Ts'o's avatar
      [PATCH] Add TAINT_USER and ability to set taint flags from userspace · 34f5a398
      Theodore Ts'o authored
      
      Allow taint flags to be set from userspace by writing to
      /proc/sys/kernel/tainted, and add a new taint flag, TAINT_USER, to be used
      when userspace has potentially done something dangerous that might
      compromise the kernel.  This will allow support personnel to ask further
      questions about what may have caused the user taint flag to have been set.
      
      For example, they might examine the logs of the realtime JVM to see if the
      Java program has used the really silly, stupid, dangerous, and
      completely-non-portable direct access to physical memory feature which MUST
      be implemented according to the Real-Time Specification for Java (RTSJ).
      Sigh.  What were those silly people at Sun thinking?
      
      [akpm@osdl.org: build fix]
      [bunk@stusta.de: cleanup]
      Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      34f5a398
  26. 29 Sep, 2006 1 commit
  27. 26 Sep, 2006 2 commits
    • Arjan van de Ven's avatar
      [PATCH] Add the __stack_chk_fail() function · 3162f751
      Arjan van de Ven authored
      
      GCC emits a call to a __stack_chk_fail() function when the stack canary is
      not matching the expected value.
      
      Since this is a bad security issue; lets panic the kernel rather than limping
      along; the kernel really can't be trusted anymore when this happens.
      Signed-off-by: default avatarArjan van de Ven <arjan@linux.intel.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Signed-off-by: default avatarAndi Kleen <ak@suse.de>
      CC: Andi Kleen <ak@suse.de>
      3162f751
    • Don Zickus's avatar
      [PATCH] x86: Allow users to force a panic on NMI · 8da5adda
      Don Zickus authored
      
      To quote Alan Cox:
      
      The default Linux behaviour on an NMI of either memory or unknown is to
      continue operation. For many environments such as scientific computing
      it is preferable that the box is taken out and the error dealt with than
      an uncorrected parity/ECC error get propogated.
      
      A small number of systems do generate NMI's for bizarre random reasons
      such as power management so the default is unchanged. In other respects
      the new proc/sys entry works like the existing panic controls already in
      that directory.
      
      This is separate to the edac support - EDAC allows supported chipsets to
      handle ECC errors well, this change allows unsupported cases to at least
      panic rather than cause problems further down the line.
      Signed-off-by: default avatarDon Zickus <dzickus@redhat.com>
      Signed-off-by: default avatarAndi Kleen <ak@suse.de>
      8da5adda