23 Mar, 2011

3 commits

  • We've been burned by regressions/bugs which we later realized could have
    been triaged quicker if only we'd paid closer attention to dmesg. To make
    it easier to audit dmesg, we'd like to make DEFAULT_MESSAGE_LEVEL
    Kconfig-settable. That way we can set it to KERN_NOTICE and audit any
    messages
    Cc: Ingo Molnar
    Cc: Joe Perches
    Cc: Olof Johansson
    Cc: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Mandeep Singh Baines
     
  • For a platform with many consoles like:
    "console=tty1 console=ttyMFD2 console=ttyS0 earlyprintk=mrst"

    Each time when the non "selected_console" (tty1 and ttyMFD2 here) get
    registered, the existing kernel message will be printed out on registered
    consoles again, the "mrst" early console will get some same message for 3
    times, and "tty1" will get some for twice.

    As suggested by Andrew Morton, every time a new console is registered, it
    will be set as the "exclusive" console which will dump the already
    existing kernel messages.

    Signed-off-by: Feng Tang
    Cc: Greg KH
    Cc: Alan Cox
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Feng Tang
     
  • On some architectures, the boot process involves de-registering the boot
    console (early boot), initialize drivers and then re-register the console.

    This mechanism introduces a window in which no printk can happen on the
    console and messages are buffered and then printed once the new console is
    available.

    If a kernel crashes during this window, all it's left on the boot console
    is "console [foo] enabled, bootconsole disabled" making debug of the crash
    rather 'interesting'.

    By adding "keep_bootcon" option, do not unregister the boot console, that
    will allow to printk everything that is happening up to the crash.

    The option is clearly meant only for debugging purposes as it introduces
    lots of duplicated info printed on console, but will make bug report from
    users easier as it doesn't require a kernel build just to figure out where
    we crash.

    Signed-off-by: Fabio M. Di Nitto
    Acked-by: David S. Miller
    Cc: Alan Cox
    Cc: Greg KH
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Fabio M. Di Nitto
     

17 Mar, 2011

1 commit

  • …/gregkh/driver-core-2.6

    * 'driver-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6: (50 commits)
    printk: do not mangle valid userspace syslog prefixes
    efivars: Add Documentation
    efivars: Expose efivars functionality to external drivers.
    efivars: Parameterize operations.
    efivars: Split out variable registration
    efivars: parameterize efivars
    efivars: Make efivars bin_attributes dynamic
    efivars: move efivars globals into struct efivars
    drivers:misc: ti-st: fix debugging code
    kref: Fix typo in kref documentation
    UIO: add PRUSS UIO driver support
    Fix spelling mistakes in Documentation/zh_CN/SubmittingPatches
    firmware: Fix unaligned memory accesses in dmi-sysfs
    firmware: Add documentation for /sys/firmware/dmi
    firmware: Expose DMI type 15 System Event Log
    firmware: Break out system_event_log in dmi-sysfs
    firmware: Basic dmi-sysfs support
    firmware: Add DMI entry types to the headers
    Driver core: convert platform_{get,set}_drvdata to static inline functions
    Translate linux-2.6/Documentation/magic-number.txt into Chinese
    ...

    Linus Torvalds
     

14 Mar, 2011

1 commit

  • 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 'text' > /dev/kmsg
    $ dmesg -r
    [135159.594810] text

    After:
    $ echo 'text' > /dev/kmsg
    $ dmesg -r
    [ 50.750654] text

    Cc: Lennart Poettering
    Signed-off-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    Kay Sievers
     

11 Feb, 2011

1 commit

  • In commit ce6ada35bdf7 ("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: Serge Hallyn
    Reviewed-by: James Morris
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

26 Jan, 2011

1 commit

  • 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: Torben Hohn
    Cc: Thomas Gleixner
    Cc: Greg KH
    Cc: Ingo Molnar
    Cc: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Torben Hohn
     

14 Jan, 2011

2 commits

  • dump_list_lock is used to protect dump_list in kmsg_dumper implementation,
    kmsg_dump() uses it to traverse dump_list too. But if there is contention
    on the lock, kmsg_dump() will fail, and the valuable kernel message may be
    lost.

    This patch solves this issue with RCU. Because kmsg_dump() only read the
    list, no lock is needed in kmsg_dump(). So that kmsg_dump() will never
    fail because of lock contention.

    Signed-off-by: Huang Ying
    Cc: "Paul E. McKenney"
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Huang Ying
     
  • We need to know the reason why system rebooted in support service.
    However, we can't inform our customers of the reason because final
    messages are lost on current Linux kernel.

    This patch improves the situation above because the final messages are
    saved by adding kmsg_dump() to reboot, halt, poweroff and
    emergency_restart path.

    Signed-off-by: Seiji Aguchi
    Cc: David Woodhouse
    Cc: Marco Stornelli
    Reviewed-by: Artem Bityutskiy
    Reviewed-by: KOSAKI Motohiro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Seiji Aguchi
     

10 Jan, 2011

1 commit


08 Jan, 2011

1 commit

  • * 'tty-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: (36 commits)
    serial: apbuart: Fixup apbuart_console_init()
    TTY: Add tty ioctl to figure device node of the system console.
    tty: add 'active' sysfs attribute to tty0 and console device
    drivers: serial: apbuart: Handle OF failures gracefully
    Serial: Avoid unbalanced IRQ wake disable during resume
    tty: fix typos/errors in tty_driver.h comments
    pch_uart : fix warnings for 64bit compile
    8250: fix uninitialized FIFOs
    ip2: fix compiler warning on ip2main_pci_tbl
    specialix: fix compiler warning on specialix_pci_tbl
    rocket: fix compiler warning on rocket_pci_ids
    8250: add a UPIO_DWAPB32 for 32 bit accesses
    8250: use container_of() instead of casting
    serial: omap-serial: Add support for kernel debugger
    serial: fix pch_uart kconfig & build
    drivers: char: hvc: add arm JTAG DCC console support
    RS485 documentation: add 16C950 UART description
    serial: ifx6x60: fix memory leak
    serial: ifx6x60: free IRQ on error
    Serial: EG20T: add PCH_UART driver
    ...

    Fixed up conflicts in drivers/serial/apbuart.c with evil merge that
    makes the code look fairly sane (unlike either side).

    Linus Torvalds
     

17 Dec, 2010

1 commit

  • tty: add 'active' sysfs attribute to tty0 and console device

    Userspace can query the actual virtual console, and the configured
    console devices behind /dev/tt0 and /dev/console.

    The last entry in the list of devices is the active device, analog
    to the console= kernel command line option.

    The attribute supports poll(), which is raised when the virtual
    console is changed or /dev/console is reconfigured.

    Signed-off-by: Kay Sievers
    Signed-off-by: Greg Kroah-Hartman

    index 0000000..b138b66

    Kay Sievers
     

09 Dec, 2010

2 commits

  • Eric Paris pointed out that it doesn't make sense to require
    both CAP_SYS_ADMIN and CAP_SYSLOG for certain syslog actions.
    So require CAP_SYSLOG, not CAP_SYS_ADMIN, when dmesg_restrict
    is set.

    (I'm also consolidating the now common error path)

    Signed-off-by: Serge E. Hallyn
    Acked-by: Eric Paris
    Acked-by: Kees Cook
    Signed-off-by: James Morris

    Serge E. Hallyn
     
  • __get_cpu_var() is a bit inefficient, lets use __this_cpu_read() and
    __this_cpu_write() to manipulate printk_pending.

    printk_needs_cpu(cpu) is called only for the current cpu :
    Use faster __this_cpu_read().

    Remove the redundant unlikely on (cpu_is_offline(cpu)) test:

    # size kernel/printk.o*
    text data bss dec hex filename
    9942 756 263488 274186 42f0a kernel/printk.o.new
    9990 756 263488 274234 42f3a kernel/printk.o.old

    Signed-off-by: Eric Dumazet
    Cc: Heiko Carstens
    Cc: H. Peter Anvin
    Cc: Christoph Lameter
    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Eric Dumazet
     

29 Nov, 2010

1 commit

  • 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: Serge Hallyn
    Acked-by: Andrew G. Morgan
    Acked-By: Kees Cook
    Cc: James Morris
    Cc: Michael Kerrisk
    Cc: Stephen Smalley
    Cc: "Christopher J. PeBenito"
    Cc: Eric Paris
    Signed-off-by: James Morris

    Serge E. Hallyn
     

26 Nov, 2010

2 commits

  • 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: Heiko Carstens
    Signed-off-by: Peter Zijlstra
    Cc: stable@kernel.org
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    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: Heiko Carstens
    Acked-by: Eric Dumazet
    Signed-off-by: Peter Zijlstra
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Heiko Carstens
     

17 Nov, 2010

1 commit


16 Nov, 2010

1 commit

  • The addition of CONFIG_SECURITY_DMESG_RESTRICT resulted in a build
    failure when CONFIG_PRINTK=n. This is because the capabilities code
    which used the new option was built even though the variable in question
    didn't exist.

    The patch here fixes this by moving the capabilities checks out of the
    LSM and into the caller. All (known) LSMs should have been calling the
    capabilities hook already so it actually makes the code organization
    better to eliminate the hook altogether.

    Signed-off-by: Eric Paris
    Acked-by: James Morris
    Signed-off-by: Linus Torvalds

    Eric Paris
     

12 Nov, 2010

1 commit

  • The kernel syslog contains debugging information that is often useful
    during exploitation of other vulnerabilities, such as kernel heap
    addresses. Rather than futilely attempt to sanitize hundreds (or
    thousands) of printk statements and simultaneously cripple useful
    debugging functionality, it is far simpler to create an option that
    prevents unprivileged users from reading the syslog.

    This patch, loosely based on grsecurity's GRKERNSEC_DMESG, creates the
    dmesg_restrict sysctl. When set to "0", the default, no restrictions are
    enforced. When set to "1", only users with CAP_SYS_ADMIN can read the
    kernel syslog via dmesg(8) or other mechanisms.

    [akpm@linux-foundation.org: explain the config option in kernel.txt]
    Signed-off-by: Dan Rosenberg
    Acked-by: Ingo Molnar
    Acked-by: Eugene Teo
    Acked-by: Kees Cook
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Dan Rosenberg
     

27 Oct, 2010

3 commits

  • get_option() takes its 2nd arg as int * so passing boot_delay to it
    caused following warnings from sparse:

    kernel/printk.c:223:27: warning: incorrect type in argument 2 (different signedness)
    kernel/printk.c:223:27: expected int *pint
    kernel/printk.c:223:27: got unsigned int static [toplevel] *

    Since boot_delay can't grow more than 10,000 changing it to 'int *'
    will not produce any problem.

    Signed-off-by: Namhyung Kim
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Namhyung Kim
     
  • acquire_console_semaphore_for_printk() releases logbuf_lock but
    was missing proper annotation. Add it.

    Signed-off-by: Namhyung Kim
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Namhyung Kim
     
  • Move redundant 'const' after '*' to make pointer itself const

    Signed-off-by: Namhyung Kim
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Namhyung Kim
     

12 Oct, 2010

1 commit


10 Aug, 2010

1 commit

  • kmsg_dump takes care to sample the global variables
    inside a spinlock, but then goes on to use the same
    variables outside the spinlock region too.

    Use the correct variable. This will make the race
    window smaller.

    Found by gcc 4.6's new warnings.

    Signed-off-by: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andi Kleen
     

05 Aug, 2010

1 commit

  • 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: Kevin Cernekee
    To:
    To:
    To:
    To:
    To:
    Cc:
    Cc:
    Reviewed-by: Paul Mundt
    Signed-off-by: Kevin Cernekee
    Patchwork: https://patchwork.linux-mips.org/patch/1534/
    LKML-Reference:
    LKML-Reference:
    Signed-off-by: Ralf Baechle

    Kevin Cernekee
     

21 May, 2010

2 commits

  • Certain calls from the kdb shell will call out to printk(), and any of
    these calls should get vectored back to the kdb_printf() so that the
    kdb pager and processing can be used, as well as to properly channel
    I/O to the polled I/O devices.

    CC: Randy Dunlap
    Signed-off-by: Jason Wessel
    Acked-by: Andrew Morton

    Jason Wessel
     
  • This patch contains the hooks and instrumentation into kernel which
    live outside the kernel/debug directory, which the kdb core
    will call to run commands like lsmod, dmesg, bt etc...

    CC: linux-arch@vger.kernel.org
    Signed-off-by: Jason Wessel
    Signed-off-by: Martin Hicks

    Jason Wessel
     

07 Mar, 2010

1 commit


01 Mar, 2010

1 commit


04 Feb, 2010

2 commits

  • Right now the syslog "type" action are just raw numbers which makes
    the source difficult to follow. This patch replaces the raw numbers
    with defined constants for some level of sanity.

    Signed-off-by: Kees Cook
    Acked-by: John Johansen
    Acked-by: Serge Hallyn
    Signed-off-by: James Morris

    Kees Cook
     
  • This allows the LSM to distinguish between syslog functions originating
    from /proc/kmsg access and direct syscalls. By default, the commoncaps
    will now no longer require CAP_SYS_ADMIN to read an opened /proc/kmsg
    file descriptor. For example the kernel syslog reader can now drop
    privileges after opening /proc/kmsg, instead of staying privileged with
    CAP_SYS_ADMIN. MAC systems that implement security_syslog have unchanged
    behavior.

    Signed-off-by: Kees Cook
    Acked-by: Serge Hallyn
    Acked-by: John Johansen
    Signed-off-by: James Morris

    Kees Cook
     

25 Jan, 2010

1 commit


01 Jan, 2010

1 commit

  • crash_kexec gets called before kmsg_dump(KMSG_DUMP_OOPS) if
    panic_on_oops is set, so the kernel log buffer is not stored
    for this case.

    This patch adds a KMSG_DUMP_KEXEC dump type which gets called
    when crash_kexec() is invoked. To avoid getting double dumps,
    the old KMSG_DUMP_PANIC is moved below crash_kexec(). The
    mtdoops driver is modified to handle KMSG_DUMP_KEXEC in the
    same way as a panic.

    Signed-off-by: KOSAKI Motohiro
    Acked-by: Simon Kagstrom
    Signed-off-by: David Woodhouse

    KOSAKI Motohiro
     

18 Dec, 2009

1 commit

  • Fix kernel-doc warnings in printk.c:

    Warning(kernel/printk.c:1422): No description found for parameter 'dumper'
    Warning(kernel/printk.c:1422): Excess function parameter 'dump' description in 'kmsg_dump_register'
    Warning(kernel/printk.c:1451): No description found for parameter 'dumper'
    Warning(kernel/printk.c:1451): Excess function parameter 'dump' description in 'kmsg_dump_unregister'

    Signed-off-by: Randy Dunlap
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Randy Dunlap
     

17 Dec, 2009

1 commit

  • * git://git.infradead.org/mtd-2.6: (90 commits)
    jffs2: Fix long-standing bug with symlink garbage collection.
    mtd: OneNAND: Fix test of unsigned in onenand_otp_walk()
    mtd: cfi_cmdset_0002, fix lock imbalance
    Revert "mtd: move mxcnd_remove to .exit.text"
    mtd: m25p80: add support for Macronix MX25L4005A
    kmsg_dump: fix build for CONFIG_PRINTK=n
    mtd: nandsim: add support for 4KiB pages
    mtd: mtdoops: refactor as a kmsg_dumper
    mtd: mtdoops: make record size configurable
    mtd: mtdoops: limit the maximum mtd partition size
    mtd: mtdoops: keep track of used/unused pages in an array
    mtd: mtdoops: several minor cleanups
    core: Add kernel message dumper to call on oopses and panics
    mtd: add ARM pismo support
    mtd: pxa3xx_nand: Fix PIO data transfer
    mtd: nand: fix multi-chip suspend problem
    mtd: add support for switching old SST chips into QRY mode
    mtd: fix M29W800D dev_id and uaddr
    mtd: don't use PF_MEMALLOC
    mtd: Add bad block table overrides to Davinci NAND driver
    ...

    Fixed up conflicts (mostly trivial) in
    drivers/mtd/devices/m25p80.c
    drivers/mtd/maps/pcmciamtd.c
    drivers/mtd/nand/pxa3xx_nand.c
    kernel/printk.c

    Linus Torvalds
     

06 Dec, 2009

1 commit


02 Dec, 2009

1 commit

  • kmsg_dump() fails to build when CONFIG_PRINTK=n; provide stubs
    for the kmsg_dump*() functions when CONFIG_PRINTK=n.

    kernel/printk.c: In function 'kmsg_dump':
    kernel/printk.c:1501: error: 'log_buf_len' undeclared (first use in this function)
    kernel/printk.c:1502: error: 'logged_chars' undeclared (first use in this function)
    kernel/printk.c:1506: error: 'log_buf' undeclared (first use in this function)

    Signed-off-by: Randy Dunlap
    Acked-by: Simon Kagstrom
    Signed-off-by: David Woodhouse

    Randy Dunlap
     

30 Nov, 2009

1 commit

  • The core functionality is implemented as per Linus suggestion from

    http://lists.infradead.org/pipermail/linux-mtd/2009-October/027620.html

    (with the kmsg_dump implementation by Linus). A struct kmsg_dumper has
    been added which contains a callback to dump the kernel log buffers on
    crashes. The kmsg_dump function gets called from oops_exit() and panic()
    and invokes this callbacks with the crash reason.

    [dwmw2: Fix log_end handling]
    Signed-off-by: Simon Kagstrom
    Reviewed-by: Anders Grafstrom
    Reviewed-by: Linus Torvalds
    Acked-by: Ingo Molnar
    Signed-off-by: Artem Bityutskiy
    Signed-off-by: David Woodhouse

    Simon Kagstrom
     

23 Oct, 2009

1 commit

  • 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: Christian Borntraeger
    Cc: Dave Young
    Cc: Linus Torvalds
    CC: Andrew Morton
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Christian Borntraeger