1. 15 2月, 2018 6 次提交
  2. 08 2月, 2018 4 次提交
    • A
      crypto: sun4i_ss_prng - convert lock to _bh in sun4i_ss_prng_generate · 2e7d1d61
      Artem Savkov 提交于
      Lockdep detects a possible deadlock in sun4i_ss_prng_generate() and
      throws an "inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage" warning.
      Disabling softirqs to fix this.
      
      Fixes: b8ae5c73 ("crypto: sun4i-ss - support the Security System PRNG")
      Signed-off-by: NArtem Savkov <artem.savkov@gmail.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      2e7d1d61
    • A
      crypto: sun4i_ss_prng - fix return value of sun4i_ss_prng_generate · dd78c832
      Artem Savkov 提交于
      According to crypto/rng.h generate function should return 0 on success
      and < 0 on error.
      
      Fixes: b8ae5c73 ("crypto: sun4i-ss - support the Security System PRNG")
      Signed-off-by: NArtem Savkov <artem.savkov@gmail.com>
      Acked-by: NCorentin Labbe <clabbe.montjoie@gmail.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      dd78c832
    • H
      crypto: caam - fix endless loop when DECO acquire fails · 225ece3e
      Horia Geantă 提交于
      In case DECO0 cannot be acquired - i.e. run_descriptor_deco0() fails
      with -ENODEV, caam_probe() enters an endless loop:
      
      run_descriptor_deco0
      	ret -ENODEV
      	-> instantiate_rng
      		-ENODEV, overwritten by -EAGAIN
      		ret -EAGAIN
      		-> caam_probe
      			-EAGAIN results in endless loop
      
      It turns out the error path in instantiate_rng() is incorrect,
      the checks are done in the wrong order.
      
      Cc: <stable@vger.kernel.org> # 3.13+
      Fixes: 1005bccd ("crypto: caam - enable instantiation of all RNG4 state handles")
      Reported-by: NBryan O'Donoghue <pure.logic@nexus-software.ie>
      Suggested-by: NAuer Lukas <lukas.auer@aisec.fraunhofer.de>
      Signed-off-by: NHoria Geantă <horia.geanta@nxp.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      225ece3e
    • L
      crypto: talitos - fix Kernel Oops on hashing an empty file · 87a81dce
      LEROY Christophe 提交于
      Performing the hash of an empty file leads to a kernel Oops
      
      [   44.504600] Unable to handle kernel paging request for data at address 0x0000000c
      [   44.512819] Faulting instruction address: 0xc02d2be8
      [   44.524088] Oops: Kernel access of bad area, sig: 11 [#1]
      [   44.529171] BE PREEMPT CMPC885
      [   44.532232] CPU: 0 PID: 491 Comm: md5sum Not tainted 4.15.0-rc8-00211-g3a968610b6ea #81
      [   44.540814] NIP:  c02d2be8 LR: c02d2984 CTR: 00000000
      [   44.545812] REGS: c6813c90 TRAP: 0300   Not tainted  (4.15.0-rc8-00211-g3a968610b6ea)
      [   44.554223] MSR:  00009032 <EE,ME,IR,DR,RI>  CR: 48222822  XER: 20000000
      [   44.560855] DAR: 0000000c DSISR: c0000000
      [   44.560855] GPR00: c02d28fc c6813d40 c6828000 c646fa40 00000001 00000001 00000001 00000000
      [   44.560855] GPR08: 0000004c 00000000 c000bfcc 00000000 28222822 100280d4 00000000 10020008
      [   44.560855] GPR16: 00000000 00000020 00000000 00000000 10024008 00000000 c646f9f0 c6179a10
      [   44.560855] GPR24: 00000000 00000001 c62f0018 c6179a10 00000000 c6367a30 c62f0000 c646f9c0
      [   44.598542] NIP [c02d2be8] ahash_process_req+0x448/0x700
      [   44.603751] LR [c02d2984] ahash_process_req+0x1e4/0x700
      [   44.608868] Call Trace:
      [   44.611329] [c6813d40] [c02d28fc] ahash_process_req+0x15c/0x700 (unreliable)
      [   44.618302] [c6813d90] [c02060c4] hash_recvmsg+0x11c/0x210
      [   44.623716] [c6813db0] [c0331354] ___sys_recvmsg+0x98/0x138
      [   44.629226] [c6813eb0] [c03332c0] __sys_recvmsg+0x40/0x84
      [   44.634562] [c6813f10] [c03336c0] SyS_socketcall+0xb8/0x1d4
      [   44.640073] [c6813f40] [c000d1ac] ret_from_syscall+0x0/0x38
      [   44.645530] Instruction dump:
      [   44.648465] 38c00001 7f63db78 4e800421 7c791b78 54690ffe 0f090000 80ff0190 2f870000
      [   44.656122] 40befe50 2f990001 409e0210 813f01bc <8129000c> b39e003a 7d29c214 913e003c
      
      This patch fixes that Oops by checking if src is NULL.
      
      Fixes: 6a1e8d14 ("crypto: talitos - making mapping helpers more generic")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NChristophe Leroy <christophe.leroy@c-s.fr>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      87a81dce
  3. 25 1月, 2018 5 次提交
  4. 20 1月, 2018 1 次提交
  5. 18 1月, 2018 8 次提交
  6. 12 1月, 2018 2 次提交
    • E
      crypto: hash - annotate algorithms taking optional key · a208fa8f
      Eric Biggers 提交于
      We need to consistently enforce that keyed hashes cannot be used without
      setting the key.  To do this we need a reliable way to determine whether
      a given hash algorithm is keyed or not.  AF_ALG currently does this by
      checking for the presence of a ->setkey() method.  However, this is
      actually slightly broken because the CRC-32 algorithms implement
      ->setkey() but can also be used without a key.  (The CRC-32 "key" is not
      actually a cryptographic key but rather represents the initial state.
      If not overridden, then a default initial state is used.)
      
      Prepare to fix this by introducing a flag CRYPTO_ALG_OPTIONAL_KEY which
      indicates that the algorithm has a ->setkey() method, but it is not
      required to be called.  Then set it on all the CRC-32 algorithms.
      
      The same also applies to the Adler-32 implementation in Lustre.
      
      Also, the cryptd and mcryptd templates have to pass through the flag
      from their underlying algorithm.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NEric Biggers <ebiggers@google.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      a208fa8f
    • H
      crypto: Use zeroing memory allocator instead of allocator/memset · 75d68369
      Himanshu Jha 提交于
      Use dma_zalloc_coherent for allocating zeroed
      memory and remove unnecessary memset function.
      
      Done using Coccinelle.
      Generated-by: scripts/coccinelle/api/alloc/kzalloc-simple.cocci
      0-day tested with no failures.
      Signed-off-by: NHimanshu Jha <himanshujha199640@gmail.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      75d68369
  7. 10 1月, 2018 1 次提交
    • C
      dma-mapping: move swiotlb arch helpers to a new header · ea8c64ac
      Christoph Hellwig 提交于
      phys_to_dma, dma_to_phys and dma_capable are helpers published by
      architecture code for use of swiotlb and xen-swiotlb only.  Drivers are
      not supposed to use these directly, but use the DMA API instead.
      
      Move these to a new asm/dma-direct.h helper, included by a
      linux/dma-direct.h wrapper that provides the default linear mapping
      unless the architecture wants to override it.
      
      In the MIPS case the existing dma-coherent.h is reused for now as
      untangling it will take a bit of work.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Acked-by: NRobin Murphy <robin.murphy@arm.com>
      ea8c64ac
  8. 05 1月, 2018 7 次提交
  9. 28 12月, 2017 5 次提交
  10. 22 12月, 2017 1 次提交
    • A
      crypto: inside-secure - EIP97 support · 871df319
      Antoine Ténart 提交于
      The Inside Secure SafeXcel driver was firstly designed to support the
      EIP197 cryptographic engine which is an evolution (with much more
      feature, better performances) of the EIP97 cryptographic engine. This
      patch convert the Inside Secure SafeXcel driver to support both engines
      (EIP97 + EIP197).
      
      The main differences are the register offsets and the context
      invalidation process which is EIP197 specific. This patch adds an
      indirection on the register offsets and adds checks not to send any
      invalidation request when driving the EIP97. A new compatible is added
      as well to bind the driver from device trees.
      Signed-off-by: NAntoine Tenart <antoine.tenart@free-electrons.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      871df319