You need to sign in or sign up before continuing.
  1. 04 4月, 2014 3 次提交
  2. 18 2月, 2014 1 次提交
    • L
      printk: fix syslog() overflowing user buffer · e4178d80
      Linus Torvalds 提交于
      This is not a buffer overflow in the traditional sense: we don't
      overflow any *kernel* buffers, but we do mis-count the amount of data we
      copy back to user space for the SYSLOG_ACTION_READ_ALL case.
      
      In particular, if the user buffer is too small to hold everything, and
      *if* there is a continuation line at just the right place, we can end up
      giving the user more data than he asked for.
      
      The reason is that we first count up the number of bytes all the log
      records contains, then we walk the records again until we've skipped the
      records at the beginning that won't fit, and then we walk the rest of
      the records and copy them to the user space buffer.
      
      And in between that "skip the initial records that won't fit" and the
      "copy the records that *will* fit to user space", we reset the 'prev'
      variable that contained the record information for the last record not
      copied.  That meant that when we started copying to user space, we now
      had a different character count than what we had originally calculated
      in the first record walk-through.
      
      The fix is to simply not clear the 'prev' flags value (in both cases
      where we had the same logic: syslog_print_all and kmsg_dump_get_buffer:
      the latter is used for pstore-like dumping)
      Reported-and-tested-by: NDebabrata Banerjee <dbanerje@akamai.com>
      Acked-by: NKay Sievers <kay@vrfy.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jeff Mahoney <jeffm@suse.com>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      e4178d80
  3. 24 1月, 2014 1 次提交
    • A
      printk: flush conflicting continuation line · 1d3fa370
      Arun KS 提交于
      An earlier newline was missing and current print is from different task.
      In this scenario flush the continuation line and store this line
      seperatly.
      
      This patch fix the below scenario of timestamp interleaving,
         [   28.154370 ] read_word_reg : reg[0x 3], reg[0x 4]  data [0x 642]
         [   28.155428 ] uart disconnect
         [   31.947341 ] dvfs[cpufreq.c<275>]:plug-in cpu<1> done
         [   28.155445 ] UART detached : send switch state 201
         [   32.014112 ] read_reg : reg[0x 3] data[0x21]
      
      [akpm@linux-foundation.org: simplify and condense the code]
      Signed-off-by: NArun KS <getarunks@gmail.com>
      Signed-off-by: NArun KS <arun.ks@broadcom.com>
      Cc: Joe Perches <joe@perches.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Paul Gortmaker <paul.gortmaker@windriver.com>
      Cc: Kay Sievers <kay@vrfy.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      1d3fa370
  4. 22 1月, 2014 1 次提交
    • S
      kernel/printk/printk.c: use memblock apis for early memory allocations · 9da791df
      Santosh Shilimkar 提交于
      Switch to memblock interfaces for early memory allocator instead of
      bootmem allocator.  No functional change in beahvior than what it is in
      current code from bootmem users points of view.
      
      Archs already converted to NO_BOOTMEM now directly use memblock
      interfaces instead of bootmem wrappers build on top of memblock.  And
      the archs which still uses bootmem, these new apis just fallback to
      exiting bootmem APIs.
      Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NSantosh Shilimkar <santosh.shilimkar@ti.com>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Christoph Lameter <cl@linux-foundation.org>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
      Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: Paul Walmsley <paul@pwsan.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Tony Lindgren <tony@atomide.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      9da791df
  5. 13 11月, 2013 4 次提交
  6. 07 8月, 2013 1 次提交
    • S
      printk: Fix return of braille_register_console() · 2cfe6c4a
      Steven Rostedt 提交于
      Some of my configs I test with have CONFIG_A11Y_BRAILLE_CONSOLE set.
      When I started testing against v3.11-rc4 my console went bonkers.  Using
      ktest to bisect the issue, it came down to:
      
      commit bbeddf52 "printk: move braille console support into separate
      braille.[ch] files"
      
      Looking into the patch I found the problem.  It's with the return of
      braille_register_console().  As anything other than NULL is considered a
      failure.
      
      But for those of us that have CONFIG_A11Y_BRAILLE_CONSOLE set but do not
      define a "brl" or "brl=" on the command line, we still may want a
      console that those with sight can still use.
      
      Return NULL (success) if "brl" or "brl=" is not on the console line.
      Signed-off-by: NSteven Rostedt <rostedt@goodmis.org>
      Acked-by: NJoe Perches <joe@perches.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      2cfe6c4a
  7. 05 8月, 2013 1 次提交
    • A
      register_console: prevent adding the same console twice · 16cf48a6
      Andreas Bießmann 提交于
      This patch guards the console_drivers list to be corrupted. The
      for_each_console() macro insist on a strictly forward list ended by NULL:
      
       con0->next->con1->next->NULL
      
      Without this patch it may happen easily to destroy this list for example by
      adding 'earlyprintk' twice, especially on embedded devices where the early
      console is often a single static instance.  This will result in the following
      list:
      
       con0->next->con0
      
      This in turn will result in an endless loop in console_unlock() later on by
      printing the first __log_buf line endlessly.
      Signed-off-by: NAndreas Bießmann <andreas@biessmann.de>
      Cc: Kay Sievers <kay@vrfy.org>
      Cc: Ben Hutchings <ben@decadent.org.uk>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      16cf48a6
  8. 01 8月, 2013 5 次提交