1. 13 9月, 2011 1 次提交
  2. 26 8月, 2011 1 次提交
  3. 10 8月, 2011 1 次提交
  4. 22 6月, 2011 1 次提交
  5. 07 6月, 2011 1 次提交
  6. 25 5月, 2011 1 次提交
    • M
      printk: allocate kernel log buffer earlier · 162a7e75
      Mike Travis 提交于
      On larger systems, because of the numerous ACPI, Bootmem and EFI messages,
      the static log buffer overflows before the larger one specified by the
      log_buf_len param is allocated.  Minimize the overflow by allocating the
      new log buffer as soon as possible.
      
      On kernels without memblock, a later call to setup_log_buf from
      kernel/init.c is the fallback.
      
      [akpm@linux-foundation.org: coding-style fixes]
      [akpm@linux-foundation.org: fix CONFIG_PRINTK=n build]
      Signed-off-by: NMike Travis <travis@sgi.com>
      Cc: Yinghai Lu <yhlu.kernel@gmail.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Jack Steiner <steiner@sgi.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      162a7e75
  7. 23 3月, 2011 3 次提交
  8. 14 3月, 2011 1 次提交
    • K
      printk: do not mangle valid userspace syslog prefixes · 9d90c8d9
      Kay Sievers 提交于
      printk: do not mangle valid userspace syslog prefixes with /dev/kmsg
      
      Log messages passed to the kernel log by using /dev/kmsg or /dev/ttyprintk
      might contain a syslog prefix including the syslog facility value.
      
      This makes printk to recognize these headers properly, extract the real log
      level from it to use, and add the prefix as a proper prefix to the
      log buffer, instead of wrongly printing it as the log message text.
      
      Before:
        $ echo '<14>text' > /dev/kmsg
        $ dmesg -r
        <4>[135159.594810] <14>text
      
      After:
        $ echo '<14>text' > /dev/kmsg
        $ dmesg -r
        <14>[   50.750654] text
      
      Cc: Lennart Poettering <lennart@poettering.net>
      Signed-off-by: NKay Sievers <kay.sievers@vrfy.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      9d90c8d9
  9. 11 2月, 2011 1 次提交
    • L
      cap_syslog: accept CAP_SYS_ADMIN for now · ee24aebf
      Linus Torvalds 提交于
      In commit ce6ada35 ("security: Define CAP_SYSLOG") Serge Hallyn
      introduced CAP_SYSLOG, but broke backwards compatibility by no longer
      accepting CAP_SYS_ADMIN as an override (it would cause a warning and
      then reject the operation).
      
      Re-instate CAP_SYS_ADMIN - but keeping the warning - as an acceptable
      capability until any legacy applications have been updated.  There are
      apparently applications out there that drop all capabilities except for
      CAP_SYS_ADMIN in order to access the syslog.
      
      (This is a re-implementation of a patch by Serge, cleaning the logic up
      and making the code more readable)
      Acked-by: NSerge Hallyn <serge@hallyn.com>
      Reviewed-by: NJames Morris <jmorris@namei.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ee24aebf
  10. 26 1月, 2011 1 次提交
    • T
      console: rename acquire/release_console_sem() to console_lock/unlock() · ac751efa
      Torben Hohn 提交于
      The -rt patches change the console_semaphore to console_mutex.  As a
      result, a quite large chunk of the patches changes all
      acquire/release_console_sem() to acquire/release_console_mutex()
      
      This commit makes things use more neutral function names which dont make
      implications about the underlying lock.
      
      The only real change is the return value of console_trylock which is
      inverted from try_acquire_console_sem()
      
      This patch also paves the way to switching console_sem from a semaphore to
      a mutex.
      
      [akpm@linux-foundation.org: coding-style fixes]
      [akpm@linux-foundation.org: make console_trylock return 1 on success, per Geert]
      Signed-off-by: NTorben Hohn <torbenh@gmx.de>
      Cc: Thomas Gleixner <tglx@tglx.de>
      Cc: Greg KH <gregkh@suse.de>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ac751efa
  11. 14 1月, 2011 2 次提交
  12. 17 12月, 2010 2 次提交
  13. 09 12月, 2010 2 次提交
  14. 29 11月, 2010 1 次提交
    • S
      security: Define CAP_SYSLOG · ce6ada35
      Serge E. Hallyn 提交于
      Privileged syslog operations currently require CAP_SYS_ADMIN.  Split
      this off into a new CAP_SYSLOG privilege which we can sanely take away
      from a container through the capability bounding set.
      
      With this patch, an lxc container can be prevented from messing with
      the host's syslog (i.e. dmesg -c).
      
      Changelog: mar 12 2010: add selinux capability2:cap_syslog perm
      Changelog: nov 22 2010:
      	. port to new kernel
      	. add a WARN_ONCE if userspace isn't using CAP_SYSLOG
      Signed-off-by: NSerge Hallyn <serge.hallyn@ubuntu.com>
      Acked-by: NAndrew G. Morgan <morgan@kernel.org>
      Acked-By: NKees Cook <kees.cook@canonical.com>
      Cc: James Morris <jmorris@namei.org>
      Cc: Michael Kerrisk <mtk.manpages@gmail.com>
      Cc: Stephen Smalley <sds@tycho.nsa.gov>
      Cc: "Christopher J. PeBenito" <cpebenito@tresys.com>
      Cc: Eric Paris <eparis@parisplace.org>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      ce6ada35
  15. 26 11月, 2010 2 次提交
    • H
      nohz: Fix printk_needs_cpu() return value on offline cpus · 61ab2544
      Heiko Carstens 提交于
      This patch fixes a hang observed with 2.6.32 kernels where timers got enqueued
      on offline cpus.
      
      printk_needs_cpu() may return 1 if called on offline cpus. When a cpu gets
      offlined it schedules the idle process which, before killing its own cpu, will
      call tick_nohz_stop_sched_tick(). That function in turn will call
      printk_needs_cpu() in order to check if the local tick can be disabled. On
      offline cpus this function should naturally return 0 since regardless if the
      tick gets disabled or not the cpu will be dead short after. That is besides the
      fact that __cpu_disable() should already have made sure that no interrupts on
      the offlined cpu will be delivered anyway.
      
      In this case it prevents tick_nohz_stop_sched_tick() to call
      select_nohz_load_balancer(). No idea if that really is a problem. However what
      made me debug this is that on 2.6.32 the function get_nohz_load_balancer() is
      used within __mod_timer() to select a cpu on which a timer gets enqueued. If
      printk_needs_cpu() returns 1 then the nohz_load_balancer cpu doesn't get
      updated when a cpu gets offlined. It may contain the cpu number of an offline
      cpu. In turn timers get enqueued on an offline cpu and not very surprisingly
      they never expire and cause system hangs.
      
      This has been observed 2.6.32 kernels. On current kernels __mod_timer() uses
      get_nohz_timer_target() which doesn't have that problem. However there might be
      other problems because of the too early exit tick_nohz_stop_sched_tick() in
      case a cpu goes offline.
      
      Easiest way to fix this is just to test if the current cpu is offline and call
      printk_tick() directly which clears the condition.
      
      Alternatively I tried a cpu hotplug notifier which would clear the condition,
      however between calling the notifier function and printk_needs_cpu() something
      could have called printk() again and the problem is back again. This seems to
      be the safest fix.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: stable@kernel.org
      LKML-Reference: <20101126120235.406766476@de.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      61ab2544
    • H
      printk: Fix wake_up_klogd() vs cpu hotplug · 49f41383
      Heiko Carstens 提交于
      wake_up_klogd() may get called from preemptible context but uses
      __raw_get_cpu_var() to write to a per cpu variable. If it gets preempted
      between getting the address and writing to it, the cpu in question could be
      offline if the process gets scheduled back and hence writes to the per cpu data
      of an offline cpu.
      
      This buggy behaviour was introduced with fa33507a "printk: robustify
      printk, fix #2" which was supposed to fix a "using smp_processor_id() in
      preemptible" warning.
      
      Let's use this_cpu_write() instead which disables preemption and makes sure
      that the outlined scenario cannot happen.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Acked-by: NEric Dumazet <eric.dumazet@gmail.com>
      Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
      LKML-Reference: <20101126124247.GC7023@osiris.boeblingen.de.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      49f41383
  16. 17 11月, 2010 1 次提交
  17. 16 11月, 2010 1 次提交
  18. 12 11月, 2010 1 次提交
  19. 27 10月, 2010 3 次提交
  20. 12 10月, 2010 1 次提交
  21. 10 8月, 2010 1 次提交
  22. 05 8月, 2010 1 次提交
    • K
      printk: fix delayed messages from CPU hotplug events · 034260d6
      Kevin Cernekee 提交于
      When a secondary CPU is being brought up, it is not uncommon for
      printk() to be invoked when cpu_online(smp_processor_id()) == 0.  The
      case that I witnessed personally was on MIPS:
      
      http://lkml.org/lkml/2010/5/30/4
      
      If (can_use_console() == 0), printk() will spool its output to log_buf
      and it will be visible in "dmesg", but that output will NOT be echoed to
      the console until somebody calls release_console_sem() from a CPU that
      is online.  Therefore, the boot time messages from the new CPU can get
      stuck in "limbo" for a long time, and might suddenly appear on the
      screen when a completely unrelated event (e.g. "eth0: link is down")
      occurs.
      
      This patch modifies the console code so that any pending messages are
      automatically flushed out to the console whenever a CPU hotplug
      operation completes successfully or aborts.
      
      The issue was seen on 2.6.34.
      
      Original patch by Kevin Cernekee with cleanups by akpm and additional fixes
      by Santosh Shilimkar.  This patch superseeds
      https://patchwork.linux-mips.org/patch/1357/.
      Signed-off-by: NKevin Cernekee <cernekee@gmail.com>
      To: <mingo@elte.hu>
      To: <akpm@linux-foundation.org>
      To: <simon.kagstrom@netinsight.net>
      To: <David.Woodhouse@intel.com>
      To: <lethal@linux-sh.org>
      Cc: <linux-kernel@vger.kernel.org>
      Cc: <linux-mips@linux-mips.org>
      Reviewed-by: NPaul Mundt <lethal@linux-sh.org>
      Signed-off-by: NKevin Cernekee <cernekee@gmail.com>
      Patchwork: https://patchwork.linux-mips.org/patch/1534/
      LKML-Reference: <ede63b5a20af951c755736f035d1e787772d7c28@localhost>
      LKML-Reference: <EAF47CD23C76F840A9E7FCE10091EFAB02C5DB6D1F@dbde02.ent.ti.com>
      Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
      034260d6
  23. 21 5月, 2010 2 次提交
  24. 07 3月, 2010 1 次提交
  25. 04 2月, 2010 2 次提交
  26. 01 1月, 2010 1 次提交
  27. 18 12月, 2009 1 次提交
  28. 02 12月, 2009 1 次提交
  29. 30 11月, 2009 1 次提交
  30. 23 10月, 2009 1 次提交
    • C
      ratelimit: Make suppressed output messages more useful · 5c828713
      Christian Borntraeger 提交于
      Today I got:
      
        [39648.224782] Registered led device: iwl-phy0::TX
        [40676.545099] __ratelimit: 246 callbacks suppressed
        [40676.545103] abcdef[23675]: segfault at 0 ...
      
      as you can see the ratelimit message contains a function prefix.
      Since this is always __ratelimit, this wont help much.
      
      This patch changes __ratelimit and printk_ratelimit to print the
      function name that calls ratelimit.
      
      This will pinpoint the responsible function, as long as not several
      different places call ratelimit with the same ratelimit state at
      the same time. In that case we catch only one random function that
      calls ratelimit after the wait period.
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Cc: Dave Young <hidave.darkstar@gmail.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      CC: Andrew Morton <akpm@linux-foundation.org>
      LKML-Reference: <200910231458.11832.borntraeger@de.ibm.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5c828713