Skip to content
Snippets Groups Projects
  1. Aug 08, 2016
  2. Aug 02, 2016
  3. Jul 29, 2016
  4. Jul 28, 2016
  5. Jul 26, 2016
  6. Jul 15, 2016
  7. Jul 07, 2016
    • Thomas Gleixner's avatar
      timers: Remove set_timer_slack() leftovers · 53bf837b
      Thomas Gleixner authored
      
      We now have implicit batching in the timer wheel. The slack API is no longer
      used, so remove it.
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Andrew F. Davis <afd@ti.com>
      Cc: Arjan van de Ven <arjan@infradead.org>
      Cc: Chris Mason <clm@fb.com>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
      Cc: Eric Dumazet <edumazet@google.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: George Spelvin <linux@sciencehorizons.net>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Jaehoon Chung <jh80.chung@samsung.com>
      Cc: Jens Axboe <axboe@kernel.dk>
      Cc: John Stultz <john.stultz@linaro.org>
      Cc: Josh Triplett <josh@joshtriplett.org>
      Cc: Len Brown <lenb@kernel.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Mathias Nyman <mathias.nyman@intel.com>
      Cc: Pali Rohár <pali.rohar@gmail.com>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Sebastian Reichel <sre@kernel.org>
      Cc: Ulf Hansson <ulf.hansson@linaro.org>
      Cc: linux-block@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Cc: linux-mmc@vger.kernel.org
      Cc: linux-pm@vger.kernel.org
      Cc: linux-usb@vger.kernel.org
      Cc: netdev@vger.kernel.org
      Cc: rt@linutronix.de
      Link: http://lkml.kernel.org/r/20160704094342.189813118@linutronix.de
      
      
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      53bf837b
  8. Jul 06, 2016
  9. Jul 03, 2016
  10. Jul 01, 2016
    • Herbert Xu's avatar
      lib/mpi: Do not do sg_virt · 127827b9
      Herbert Xu authored
      
      Currently the mpi SG helpers use sg_virt which is completely
      broken.  It happens to work with normal kernel memory but will
      fail with anything that is not linearly mapped.
      
      This patch fixes this by using the SG iterator helpers.
      
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      127827b9
    • Herbert Xu's avatar
      crypto: rsa - Generate fixed-length output · 9b45b7bb
      Herbert Xu authored
      
      Every implementation of RSA that we have naturally generates
      output with leading zeroes.  The one and only user of RSA,
      pkcs1pad wants to have those leading zeroes in place, in fact
      because they are currently absent it has to write those zeroes
      itself.
      
      So we shouldn't be stripping leading zeroes in the first place.
      In fact this patch makes rsa-generic produce output with fixed
      length so that pkcs1pad does not need to do any extra work.
      
      This patch also changes DH to use the new interface.
      
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      9b45b7bb
  11. Jun 16, 2016
    • Peter Zijlstra's avatar
      locking/atomic: Implement... · 28aa2bda
      Peter Zijlstra authored
      locking/atomic: Implement atomic{,64,_long}_fetch_{add,sub,and,andnot,or,xor}{,_relaxed,_acquire,_release}()
      
      Now that all the architectures have implemented support for these new
      atomic primitives add on the generic infrastructure to expose and use
      it.
      
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Boqun Feng <boqun.feng@gmail.com>
      Cc: Borislav Petkov <bp@suse.de>
      Cc: Davidlohr Bueso <dave@stgolabs.net>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: linux-arch@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      28aa2bda
  12. Jun 14, 2016
  13. Jun 11, 2016
    • Linus Torvalds's avatar
      vfs: make the string hashes salt the hash · 8387ff25
      Linus Torvalds authored
      
      We always mixed in the parent pointer into the dentry name hash, but we
      did it late at lookup time.  It turns out that we can simplify that
      lookup-time action by salting the hash with the parent pointer early
      instead of late.
      
      A few other users of our string hashes also wanted to mix in their own
      pointers into the hash, and those are updated to use the same mechanism.
      
      Hash users that don't have any particular initial salt can just use the
      NULL pointer as a no-salt.
      
      Cc: Vegard Nossum <vegard.nossum@oracle.com>
      Cc: George Spelvin <linux@sciencehorizons.net>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8387ff25
  14. Jun 09, 2016
  15. Jun 08, 2016
  16. Jun 07, 2016
  17. May 31, 2016
    • Nicolai Stange's avatar
      lib/mpi: refactor mpi_read_from_buffer() in terms of mpi_read_raw_data() · 20b5b7f3
      Nicolai Stange authored
      
      mpi_read_from_buffer() and mpi_read_raw_data() do basically the same thing
      except that the former extracts the number of payload bits from the first
      two bytes of the input buffer.
      
      Besides that, the data copying logic is exactly the same.
      
      Replace the open coded buffer to MPI instance conversion by a call to
      mpi_read_raw_data().
      
      Signed-off-by: default avatarNicolai Stange <nicstange@gmail.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      20b5b7f3
    • Nicolai Stange's avatar
      lib/mpi: mpi_read_from_buffer(): sanitize short buffer printk · cdf24b42
      Nicolai Stange authored
      
      The first two bytes of the input buffer encode its expected length and
      mpi_read_from_buffer() prints a console message if the given buffer is too
      short.
      
      However, there are some oddities with how this message is printed:
      - It is printed at the default loglevel. This is different from the
        one used in the case that the first two bytes' value is unsupportedly
        large, i.e. KERN_INFO.
      - The format specifier '%d' is used for unsigned ints.
      - It prints the values of nread and *ret_nread. This is redundant since
        the former is always the latter + 1.
      
      Clean this up as follows:
      - Use pr_info() rather than printk() with no loglevel.
      - Use the format specifiers '%u' in place if '%d'.
      - Do not print the redundant 'nread' but the more helpful 'nbytes' value.
      
      Signed-off-by: default avatarNicolai Stange <nicstange@gmail.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      cdf24b42
    • Nicolai Stange's avatar
      lib/mpi: mpi_read_from_buffer(): return -EINVAL upon too short buffer · 7af791e0
      Nicolai Stange authored
      
      Currently, if the input buffer is shorter than the expected length as
      indicated by its first two bytes, an MPI instance of this expected length
      will be allocated and filled with as much data as is available. The rest
      will remain uninitialized.
      
      Instead of leaving this condition undetected, an error code should be
      reported to the caller.
      
      Since this situation indicates that the input buffer's first two bytes,
      encoding the number of expected bits, are garbled, -EINVAL is appropriate
      here.
      
      If the input buffer is shorter than indicated by its first two bytes,
      make mpi_read_from_buffer() return -EINVAL.
      Get rid of the 'nread' variable: with the new semantics, the total number
      of bytes read from the input buffer is known in advance.
      
      Signed-off-by: default avatarNicolai Stange <nicstange@gmail.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      7af791e0
    • Nicolai Stange's avatar
      lib/digsig: digsig_verify_rsa(): return -EINVAL if modulo length is zero · c5ce7c69
      Nicolai Stange authored
      
      Currently, if digsig_verify_rsa() detects that the modulo's length is zero,
      i.e. mlen == 0, it returns -ENOMEM which doesn't really fit here.
      
      Make digsig_verify_rsa() return -EINVAL upon mlen == 0.
      
      Signed-off-by: default avatarNicolai Stange <nicstange@gmail.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      c5ce7c69
    • Nicolai Stange's avatar
      lib/mpi: mpi_read_from_buffer(): return error code · 03cdfaad
      Nicolai Stange authored
      
      mpi_read_from_buffer() reads a MPI from a buffer into a newly allocated
      MPI instance. It expects the buffer's leading two bytes to contain the
      number of bits, followed by the actual payload.
      
      On failure, it returns NULL and updates the in/out argument ret_nread
      somewhat inconsistently:
      - If the given buffer is too short to contain the leading two bytes
        encoding the number of bits or their value is unsupported, then
        ret_nread will be cleared.
      - If the allocation of the resulting MPI instance fails, ret_nread is left
        as is.
      
      The only user of mpi_read_from_buffer(), digsig_verify_rsa(), simply checks
      for a return value of NULL and returns -ENOMEM if that happens.
      
      While this is all of cosmetic nature only, there is another error condition
      which currently isn't detectable by the caller of mpi_read_from_buffer():
      if the given buffer is too small to hold the number of bits as encoded in
      its first two bytes, the return value will be non-NULL and *ret_nread > 0.
      
      In preparation of communicating this condition to the caller, let
      mpi_read_from_buffer() return error values by means of the ERR_PTR()
      mechanism.
      
      Make the sole caller of mpi_read_from_buffer(), digsig_verify_rsa(),
      check the return value for IS_ERR() rather than == NULL. If IS_ERR() is
      true, return the associated error value rather than the fixed -ENOMEM.
      
      Signed-off-by: default avatarNicolai Stange <nicstange@gmail.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      03cdfaad
    • Nicolai Stange's avatar
      lib/mpi: mpi_read_raw_data(): fix nbits calculation · eef0df6a
      Nicolai Stange authored
      
      The number of bits, nbits, is calculated in mpi_read_raw_data() as follows:
      
        nbits = nbytes * 8;
      
      Afterwards, the number of leading zero bits of the first byte get
      subtracted:
      
        nbits -= count_leading_zeros(buffer[0]);
      
      However, count_leading_zeros() takes an unsigned long and thus,
      the u8 gets promoted to an unsigned long.
      
      Thus, the above doesn't subtract the number of leading zeros in the most
      significant nonzero input byte from nbits, but the number of leading
      zeros of the most significant nonzero input byte promoted to unsigned long,
      i.e. BITS_PER_LONG - 8 too many.
      
      Fix this by subtracting
      
        count_leading_zeros(...) - (BITS_PER_LONG - 8)
      
      from nbits only.
      
      Fixes: e1045992 ("MPILIB: Provide a function to read raw data into an
                           MPI")
      Signed-off-by: default avatarNicolai Stange <nicstange@gmail.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      eef0df6a
    • Nicolai Stange's avatar
      lib/mpi: mpi_read_raw_data(): purge redundant clearing of nbits · dfd90510
      Nicolai Stange authored
      
      In mpi_read_raw_data(), unsigned nbits is calculated as follows:
      
       nbits = nbytes * 8;
      
      and redundantly cleared later on if nbytes == 0:
      
        if (nbytes > 0)
          ...
        else
          nbits = 0;
      
      Purge this redundant clearing for the sake of clarity.
      
      Signed-off-by: default avatarNicolai Stange <nicstange@gmail.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      dfd90510
    • Nicolai Stange's avatar
      lib/mpi: purge mpi_set_buffer() · 4bdf1cfc
      Nicolai Stange authored
      
      mpi_set_buffer() has no in-tree users and similar functionality is provided
      by mpi_read_raw_data().
      
      Remove mpi_set_buffer().
      
      Signed-off-by: default avatarNicolai Stange <nicstange@gmail.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      4bdf1cfc
  18. May 30, 2016
  19. May 28, 2016
    • George Spelvin's avatar
      <linux/hash.h>: Add support for architecture-specific functions · 468a9428
      George Spelvin authored
      
      This is just the infrastructure; there are no users yet.
      
      This is modelled on CONFIG_ARCH_RANDOM; a CONFIG_ symbol declares
      the existence of <asm/hash.h>.
      
      That file may define its own versions of various functions, and define
      HAVE_* symbols (no CONFIG_ prefix!) to suppress the generic ones.
      
      Included is a self-test (in lib/test_hash.c) that verifies the basics.
      It is NOT in general required that the arch-specific functions compute
      the same thing as the generic, but if a HAVE_* symbol is defined with
      the value 1, then equality is tested.
      
      Signed-off-by: default avatarGeorge Spelvin <linux@sciencehorizons.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Greg Ungerer <gerg@linux-m68k.org>
      Cc: Andreas Schwab <schwab@linux-m68k.org>
      Cc: Philippe De Muyter <phdm@macq.eu>
      Cc: linux-m68k@lists.linux-m68k.org
      Cc: Alistair Francis <alistai@xilinx.com>
      Cc: Michal Simek <michal.simek@xilinx.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: uclinux-h8-devel@lists.sourceforge.jp
      468a9428
Loading