1. 13 Jun, 2019 1 commit
    • Eric Biggers's avatar
      crypto: make all generic algorithms set cra_driver_name · d6ebf528
      Eric Biggers authored
      Most generic crypto algorithms declare a driver name ending in
      "-generic".  The rest don't declare a driver name and instead rely on
      the crypto API automagically appending "-generic" upon registration.
      
      Having multiple conventions is unnecessarily confusing and makes it
      harder to grep for all generic algorithms in the kernel source tree.
      But also, allowing NULL driver names is problematic because sometimes
      people fail to set it, e.g. the case fixed by commit 41798036
      
      
      ("crypto: cavium/zip - fix collision with generic cra_driver_name").
      
      Of course, people can also incorrectly name their drivers "-generic".
      But that's much easier to notice / grep for.
      
      Therefore, let's make cra_driver_name mandatory.  In preparation for
      this, this patch makes all generic algorithms set cra_driver_name.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      d6ebf528
  2. 05 Jun, 2019 1 commit
  3. 18 Apr, 2019 1 commit
    • Eric Biggers's avatar
      crypto: run initcalls for generic implementations earlier · c4741b23
      Eric Biggers authored
      
      Use subsys_initcall for registration of all templates and generic
      algorithm implementations, rather than module_init.  Then change
      cryptomgr to use arch_initcall, to place it before the subsys_initcalls.
      
      This is needed so that when both a generic and optimized implementation
      of an algorithm are built into the kernel (not loadable modules), the
      generic implementation is registered before the optimized one.
      Otherwise, the self-tests for the optimized implementation are unable to
      allocate the generic implementation for the new comparison fuzz tests.
      
      Note that on arm, a side effect of this change is that self-tests for
      generic implementations may run before the unaligned access handler has
      been installed.  So, unaligned accesses will crash the kernel.  This is
      arguably a good thing as it makes it easier to detect that type of bug.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      c4741b23
  4. 20 Nov, 2018 1 commit
    • Eric Biggers's avatar
      crypto: remove useless initializations of cra_list · d4165590
      Eric Biggers authored
      
      Some algorithms initialize their .cra_list prior to registration.
      But this is unnecessary since crypto_register_alg() will overwrite
      .cra_list when adding the algorithm to the 'crypto_alg_list'.
      Apparently the useless assignment has just been copy+pasted around.
      
      So, remove the useless assignments.
      
      Exception: paes_s390.c uses cra_list to check whether the algorithm is
      registered or not, so I left that as-is for now.
      
      This patch shouldn't change any actual behavior.
      Signed-off-by: default avatarEric Biggers <ebiggers@google.com>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      d4165590
  5. 10 Apr, 2017 1 commit
  6. 25 Feb, 2017 1 commit
  7. 25 Oct, 2016 1 commit
  8. 24 Nov, 2014 1 commit
  9. 29 Aug, 2014 1 commit
    • KOVACS Krisztian's avatar
      crypto: lz4,lz4hc - fix decompression · d801ab20
      KOVACS Krisztian authored
      
      The lz4 library has two functions for decompression, with slightly
      different signatures and behaviour. The lz4_decompress_crypto() function
      seemed to be using the one that assumes that the decompressed length is
      known in advance.
      
      This patch switches to the other decompression function and makes sure
      that the length of the decompressed output is properly returned to the
      caller.
      
      The same issue was present in the lz4hc algorithm.
      
      Coincidentally, this change also makes very basic lz4 and lz4hc
      compression tests in testmgr pass.
      Signed-off-by: default avatarKOVACS Krisztian <hidden@sch.bme.hu>
      Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
      d801ab20
  10. 09 Jul, 2013 1 commit