1. 10 Oct, 2017 1 commit
  2. 07 Oct, 2017 1 commit
    • Jia-Ju Bai's avatar
      crypto: shash - Fix a sleep-in-atomic bug in shash_setkey_unaligned · 9039f3ef
      Jia-Ju Bai authored
      The SCTP program may sleep under a spinlock, and the function call path is:
      sctp_generate_t3_rtx_event (acquire the spinlock)
      For the same reason, the orinoco driver may sleep in interrupt handler,
      and the function call path is:
      To fix it, GFP_KERNEL is replaced with GFP_ATOMIC.
      This bug is found by my static analysis tool and my code review.
      Signed-off-by: default avatarJia-Ju Bai <baijiaju1990@163.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
  3. 12 Jan, 2017 1 commit
    • Gideon Israel Dsouza's avatar
      crypto: Replaced gcc specific attributes with macros from compiler.h · d8c34b94
      Gideon Israel Dsouza authored
      Continuing from this commit: 52f5684c
      ("kernel: use macros from compiler.h instead of __attribute__((...))")
      I submitted 4 total patches. They are part of task I've taken up to
      increase compiler portability in the kernel. I've cleaned up the
      subsystems under /kernel /mm /block and /security, this patch targets
      There is <linux/compiler.h> which provides macros for various gcc specific
      constructs. Eg: __weak for __attribute__((weak)). I've cleaned all
      instances of gcc specific attributes with the right macros for the crypto
      I had to make one additional change into compiler-gcc.h for the case when
      one wants to use this: __attribute__((aligned) and not specify an alignment
      factor. From the gcc docs, this will result in the largest alignment for
      that data type on the target machine so I've named the macro
      __aligned_largest. Please advise if another name is more appropriate.
      Signed-off-by: default avatarGideon Israel Dsouza <gidisrael@gmail.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
  4. 06 Feb, 2016 1 commit
  5. 27 Jan, 2016 1 commit
  6. 18 Jan, 2016 1 commit
  7. 21 Apr, 2015 1 commit
  8. 07 Jun, 2014 1 commit
  9. 19 Feb, 2013 1 commit
    • Mathias Krause's avatar
      crypto: user - fix info leaks in report API · 9a5467bf
      Mathias Krause authored
      Three errors resulting in kernel memory disclosure:
      1/ The structures used for the netlink based crypto algorithm report API
      are located on the stack. As snprintf() does not fill the remainder of
      the buffer with null bytes, those stack bytes will be disclosed to users
      of the API. Switch to strncpy() to fix this.
      2/ crypto_report_one() does not initialize all field of struct
      crypto_user_alg. Fix this to fix the heap info leak.
      3/ For the module name we should copy only as many bytes as
      module_name() returns -- not as much as the destination buffer could
      hold. But the current code does not and therefore copies random data
      from behind the end of the module name, as the module name is always
      shorter than CRYPTO_MAX_ALG_NAME.
      Also switch to use strncpy() to copy the algorithm's name and
      driver_name. They are strings, after all.
      Signed-off-by: default avatarMathias Krause <minipli@googlemail.com>
      Cc: Steffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
  10. 01 Aug, 2012 1 commit
  11. 02 Apr, 2012 1 commit
  12. 20 Mar, 2012 1 commit
  13. 10 Nov, 2011 1 commit
  14. 21 Oct, 2011 1 commit
  15. 04 Nov, 2010 1 commit
  16. 19 May, 2010 1 commit
  17. 24 Jul, 2009 1 commit
  18. 22 Jul, 2009 1 commit
    • Herbert Xu's avatar
      crypto: shash - Require all algorithms to support export/import · f592682f
      Herbert Xu authored
      This patch provides a default export/import function for all
      shash algorithms.  It simply copies the descriptor context as
      is done by sha1_generic.
      This in essence means that all existing shash algorithms now
      support export/import.  This is something that will be depended
      upon in implementations such as hmac.  Therefore all new shash
      and ahash implementations must support export/import.
      For those that cannot obtain a partial result, padlock-sha's
      fallback model should be used so that a partial result is always
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
  19. 15 Jul, 2009 2 commits
  20. 14 Jul, 2009 7 commits
  21. 12 Jul, 2009 1 commit
  22. 11 Jul, 2009 2 commits
  23. 08 Jul, 2009 6 commits
  24. 27 Mar, 2009 1 commit
  25. 18 Feb, 2009 2 commits
    • Herbert Xu's avatar
      crypto: api - Fix crypto_alloc_tfm/create_create_tfm return convention · 3f683d61
      Herbert Xu authored
      This is based on a report and patch by Geert Uytterhoeven.
      The functions crypto_alloc_tfm and create_create_tfm return a
      pointer that needs to be adjusted by the caller when successful
      and otherwise an error value.  This means that the caller has
      to check for the error and only perform the adjustment if the
      pointer returned is valid.
      Since all callers want to make the adjustment and we know how
      to adjust it ourselves, it's much easier to just return adjusted
      pointer directly.
      The only caveat is that we have to return a void * instead of
      struct crypto_tfm *.  However, this isn't that bad because both
      of these functions are for internal use only (by types code like
      shash.c, not even algorithms code).
      This patch also moves crypto_alloc_tfm into crypto/internal.h
      (crypto_create_tfm is already there) to reflect this.
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
    • Herbert Xu's avatar
      crypto: shash - Remove superfluous check in init_tfm · 1693531e
      Herbert Xu authored
      We're currently checking the frontend type in init_tfm.  This is
      completely pointless because the fact that we're called at all
      means that the frontend is ours so the type must match as well.
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
  26. 05 Feb, 2009 1 commit