Skip to content
Snippets Groups Projects
  1. May 15, 2019
  2. Apr 26, 2019
    • Petr Mladek's avatar
      vsprintf: Avoid confusion between invalid address and value · 635720ac
      Petr Mladek authored
      We are able to detect invalid values handled by %p[iI] printk specifier.
      The current error message is "invalid address". It might cause confusion
      against "(efault)" reported by the generic valid_pointer_address() check.
      
      Let's unify the style and use the more appropriate error code description
      "(einval)".
      
      Link: http://lkml.kernel.org/r/20190417115350.20479-10-pmladek@suse.com
      
      
      To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: "Tobin C . Harding" <me@tobin.cc>
      Cc: Joe Perches <joe@perches.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
      Cc: linux-kernel@vger.kernel.org
      Reviewed-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      635720ac
    • Petr Mladek's avatar
      vsprintf: Prevent crash when dereferencing invalid pointers · 3e5903eb
      Petr Mladek authored
      We already prevent crash when dereferencing some obviously broken
      pointers. But the handling is not consistent. Sometimes we print "(null)"
      only for pure NULL pointer, sometimes for pointers in the first
      page and sometimes also for pointers in the last page (error codes).
      
      Note that printk() call this code under logbuf_lock. Any recursive
      printks are redirected to the printk_safe implementation and the messages
      are stored into per-CPU buffers. These buffers might be eventually flushed
      in printk_safe_flush_on_panic() but it is not guaranteed.
      
      This patch adds a check using probe_kernel_read(). It is not a full-proof
      test. But it should help to see the error message in 99% situations where
      the kernel would silently crash otherwise.
      
      Also it makes the error handling unified for "%s" and the many %p*
      specifiers that need to read the data from a given address. We print:
      
         + (null)   when accessing data on pure pure NULL address
         + (efault) when accessing data on an invalid address
      
      It does not affect the %p* specifiers that just print the given address
      in some form, namely %pF, %pf, %pS, %ps, %pB, %pK, %px, and plain %p.
      
      Note that we print (efault) from security reasons. In fact, the real
      address can be seen only by %px or eventually %pK.
      
      Link: http://lkml.kernel.org/r/20190417115350.20479-9-pmladek@suse.com
      
      
      To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: "Tobin C . Harding" <me@tobin.cc>
      Cc: Joe Perches <joe@perches.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Michal Hocko <mhocko@suse.cz>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
      Cc: linux-kernel@vger.kernel.org
      Reviewed-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
      Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Signed-off-by: default avatarPetr Mladek <pmladek@suse.com>
      3e5903eb
  3. Apr 03, 2019
    • Peter Zijlstra's avatar
      ia64/tlb: Eradicate tlb_migrate_finish() callback · 64559598
      Peter Zijlstra authored
      
      Only ia64-sn2 uses this as an optimization, and there it is of
      questionable correctness due to the mm_users==1 test.
      
      Remove it entirely.
      
      No change in behavior intended.
      
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@surriel.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      64559598
  4. Apr 02, 2019
  5. Mar 12, 2019
  6. Mar 04, 2019
  7. Feb 20, 2019
  8. Feb 06, 2019
    • Matthew Wilcox's avatar
      XArray: Add cyclic allocation · 2fa044e5
      Matthew Wilcox authored
      
      This differs slightly from the IDR equivalent in five ways.
      
      1. It can allocate up to UINT_MAX instead of being limited to INT_MAX,
         like xa_alloc().  Also like xa_alloc(), it will write to the 'id'
         pointer before placing the entry in the XArray.
      2. The 'next' cursor is allocated separately from the XArray instead
         of being part of the IDR.  This saves memory for all the users which
         do not use the cyclic allocation API and suits some users better.
      3. It returns -EBUSY instead of -ENOSPC.
      4. It will attempt to wrap back to the minimum value on memory allocation
         failure as well as on an -EBUSY error, assuming that a user would
         rather allocate a small ID than suffer an ID allocation failure.
      5. It reports whether it has wrapped, which is important to some users.
      
      Signed-off-by: default avatarMatthew Wilcox <willy@infradead.org>
      2fa044e5
    • Matthew Wilcox's avatar
      XArray: Add support for 1s-based allocation · 3ccaf57a
      Matthew Wilcox authored
      
      A lot of places want to allocate IDs starting at 1 instead of 0.
      While the xa_alloc() API supports this, it's not very efficient if lots
      of IDs are allocated, due to having to walk down to the bottom of the
      tree to see if ID 1 is available, then all the way over to the next
      non-allocated ID.  This method marks ID 0 as being occupied which wastes
      one slot in the XArray, but preserves xa_empty() as working.
      
      Signed-off-by: default avatarMatthew Wilcox <willy@infradead.org>
      3ccaf57a
    • Matthew Wilcox's avatar
      XArray: Change xa_insert to return -EBUSY · fd9dc93e
      Matthew Wilcox authored
      
      Userspace translates EEXIST to "File exists" which isn't a very good
      error message for the problem.  "Device or resource busy" is a better
      indication of what went wrong.
      
      Signed-off-by: default avatarMatthew Wilcox <willy@infradead.org>
      fd9dc93e
  9. Feb 04, 2019
  10. Feb 01, 2019
  11. Jan 15, 2019
  12. Jan 07, 2019
  13. Jan 03, 2019
  14. Dec 20, 2018
  15. Dec 10, 2018
    • Andy Shevchenko's avatar
      lib/vsprintf: Print time and date in human readable format via %pt · 4d42c447
      Andy Shevchenko authored
      
      There are users which print time and date represented by content of
      struct rtc_time in human readable format.
      
      Instead of open coding that each time introduce %ptR[dt][r] specifier.
      
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Cc: Ingo Molnar <mingo@kernel.org>
      Cc: Jason Wessel <jason.wessel@windriver.com>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Jonathan Hunter <jonathanh@nvidia.com>
      Cc: Krzysztof Kozlowski <krzk@kernel.org>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Cc: Petr Mladek <pmladek@suse.com>
      Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
      Reviewed-by: default avatarPetr Mladek <pmladek@suse.com>
      Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
      4d42c447
  16. Dec 06, 2018
  17. Nov 20, 2018
  18. Nov 05, 2018
  19. Oct 31, 2018
    • Mike Rapoport's avatar
      docs/boot-time-mm: remove bootmem documentation · 530d4c0c
      Mike Rapoport authored
      Link: http://lkml.kernel.org/r/1536927045-23536-31-git-send-email-rppt@linux.vnet.ibm.com
      
      
      Signed-off-by: default avatarMike Rapoport <rppt@linux.vnet.ibm.com>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Chris Zankel <chris@zankel.net>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greentime Hu <green.hu@gmail.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Guan Xuetao <gxt@pku.edu.cn>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Ley Foon Tan <lftan@altera.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Matt Turner <mattst88@gmail.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Michal Hocko <mhocko@suse.com>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Palmer Dabbelt <palmer@sifive.com>
      Cc: Paul Burton <paul.burton@mips.com>
      Cc: Richard Kuo <rkuo@codeaurora.org>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Rich Felker <dalias@libc.org>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Serge Semin <fancer.lancer@gmail.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      530d4c0c
  20. Oct 21, 2018
  21. Oct 15, 2018
  22. Oct 12, 2018
Loading