1. 13 12月, 2019 3 次提交
  2. 05 12月, 2019 3 次提交
  3. 01 12月, 2019 1 次提交
    • N
      crypto: ccree - avoid implicit enum conversion · 30ca1af4
      Nathan Chancellor 提交于
      [ Upstream commit 18e732b8035d175181aae2ded127994cb01694f7 ]
      
      Clang warns when one enumerated type is implicitly converted to another
      and this happens in several locations in this driver, ultimately related
      to the set_cipher_{mode,config0} functions. set_cipher_mode expects a mode
      of type drv_cipher_mode and set_cipher_config0 expects a mode of type
      drv_crypto_direction.
      
      drivers/crypto/ccree/cc_ivgen.c:58:35: warning: implicit conversion from
      enumeration type 'enum cc_desc_direction' to different enumeration type
      'enum drv_crypto_direction' [-Wenum-conversion]
              set_cipher_config0(&iv_seq[idx], DESC_DIRECTION_ENCRYPT_ENCRYPT);
      
      drivers/crypto/ccree/cc_hash.c:99:28: warning: implicit conversion from
      enumeration type 'enum cc_hash_conf_pad' to different enumeration type
      'enum drv_crypto_direction' [-Wenum-conversion]
                      set_cipher_config0(desc, HASH_DIGEST_RESULT_LITTLE_ENDIAN);
      
      drivers/crypto/ccree/cc_aead.c:1643:30: warning: implicit conversion
      from enumeration type 'enum drv_hash_hw_mode' to different enumeration
      type 'enum drv_cipher_mode' [-Wenum-conversion]
              set_cipher_mode(&desc[idx], DRV_HASH_HW_GHASH);
      
      Since this fundamentally isn't a problem because these values just
      represent simple integers for a shift operation, make it clear to Clang
      that this is okay by making the mode parameter in both functions an int.
      
      Link: https://github.com/ClangBuiltLinux/linux/issues/46Signed-off-by: NNathan Chancellor <natechancellor@gmail.com>
      Acked-by: NGilad Ben-Yossef <gilad@benyossef.com>
      Reviewed-by: NNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      30ca1af4
  4. 24 11月, 2019 2 次提交
  5. 21 11月, 2019 2 次提交
  6. 10 11月, 2019 2 次提交
  7. 12 10月, 2019 5 次提交
    • G
      crypto: ccree - use the full crypt length value · a0dc60ac
      Gilad Ben-Yossef 提交于
      commit 7a4be6c113c1f721818d1e3722a9015fe393295c upstream.
      
      In case of AEAD decryption verifcation error we were using the
      wrong value to zero out the plaintext buffer leaving the end of
      the buffer with the false plaintext.
      Signed-off-by: NGilad Ben-Yossef <gilad@benyossef.com>
      Fixes: ff27e85a ("crypto: ccree - add AEAD support")
      CC: stable@vger.kernel.org # v4.17+
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a0dc60ac
    • G
      crypto: ccree - account for TEE not ready to report · f5c087a0
      Gilad Ben-Yossef 提交于
      commit 76a95bd8f9e10cade9c4c8df93b5c20ff45dc0f5 upstream.
      
      When ccree driver runs it checks the state of the Trusted Execution
      Environment CryptoCell driver before proceeding. We did not account
      for cases where the TEE side is not ready or not available at all.
      Fix it by only considering TEE error state after sync with the TEE
      side driver.
      Signed-off-by: NGilad Ben-Yossef <gilad@benyossef.com>
      Fixes: ab8ec965 ("crypto: ccree - add FIPS support")
      CC: stable@vger.kernel.org # v4.17+
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f5c087a0
    • H
      crypto: caam - fix concurrency issue in givencrypt descriptor · 561bf930
      Horia Geantă 提交于
      commit 48f89d2a2920166c35b1c0b69917dbb0390ebec7 upstream.
      
      IV transfer from ofifo to class2 (set up at [29][30]) is not guaranteed
      to be scheduled before the data transfer from ofifo to external memory
      (set up at [38]:
      
      [29] 10FA0004           ld: ind-nfifo (len=4) imm
      [30] 81F00010               <nfifo_entry: ofifo->class2 type=msg len=16>
      [31] 14820004           ld: ccb2-datasz len=4 offs=0 imm
      [32] 00000010               data:0x00000010
      [33] 8210010D    operation: cls1-op aes cbc init-final enc
      [34] A8080B04         math: (seqin + math0)->vseqout len=4
      [35] 28000010    seqfifold: skip len=16
      [36] A8080A04         math: (seqin + math0)->vseqin len=4
      [37] 2F1E0000    seqfifold: both msg1->2-last2-last1 len=vseqinsz
      [38] 69300000   seqfifostr: msg len=vseqoutsz
      [39] 5C20000C      seqstr: ccb2 ctx len=12 offs=0
      
      If ofifo -> external memory transfer happens first, DECO will hang
      (issuing a Watchdog Timeout error, if WDOG is enabled) waiting for
      data availability in ofifo for the ofifo -> c2 ififo transfer.
      
      Make sure IV transfer happens first by waiting for all CAAM internal
      transfers to end before starting payload transfer.
      
      New descriptor with jump command inserted at [37]:
      
      [..]
      [36] A8080A04         math: (seqin + math0)->vseqin len=4
      [37] A1000401         jump: jsl1 all-match[!nfifopend] offset=[01] local->[38]
      [38] 2F1E0000    seqfifold: both msg1->2-last2-last1 len=vseqinsz
      [39] 69300000   seqfifostr: msg len=vseqoutsz
      [40] 5C20000C      seqstr: ccb2 ctx len=12 offs=0
      
      [Note: the issue is present in the descriptor from the very beginning
      (cf. Fixes tag). However I've marked it v4.19+ since it's the oldest
      maintained kernel that the patch applies clean against.]
      
      Cc: <stable@vger.kernel.org> # v4.19+
      Fixes: 1acebad3 ("crypto: caam - faster aead implementation")
      Signed-off-by: NHoria Geantă <horia.geanta@nxp.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      561bf930
    • W
      crypto: cavium/zip - Add missing single_release() · 3683dd70
      Wei Yongjun 提交于
      commit c552ffb5c93d9d65aaf34f5f001c4e7e8484ced1 upstream.
      
      When using single_open() for opening, single_release() should be
      used instead of seq_release(), otherwise there is a memory leak.
      
      Fixes: 09ae5d37 ("crypto: zip - Add Compression/Decompression statistics")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NWei Yongjun <weiyongjun1@huawei.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3683dd70
    • A
      crypto: qat - Silence smp_processor_id() warning · 9349108a
      Alexander Sverdlin 提交于
      commit 1b82feb6c5e1996513d0fb0bbb475417088b4954 upstream.
      
      It seems that smp_processor_id() is only used for a best-effort
      load-balancing, refer to qat_crypto_get_instance_node(). It's not feasible
      to disable preemption for the duration of the crypto requests. Therefore,
      just silence the warning. This commit is similar to e7a9b05c
      ("crypto: cavium - Fix smp_processor_id() warnings").
      
      Silences the following splat:
      BUG: using smp_processor_id() in preemptible [00000000] code: cryptomgr_test/2904
      caller is qat_alg_ablkcipher_setkey+0x300/0x4a0 [intel_qat]
      CPU: 1 PID: 2904 Comm: cryptomgr_test Tainted: P           O    4.14.69 #1
      ...
      Call Trace:
       dump_stack+0x5f/0x86
       check_preemption_disabled+0xd3/0xe0
       qat_alg_ablkcipher_setkey+0x300/0x4a0 [intel_qat]
       skcipher_setkey_ablkcipher+0x2b/0x40
       __test_skcipher+0x1f3/0xb20
       ? cpumask_next_and+0x26/0x40
       ? find_busiest_group+0x10e/0x9d0
       ? preempt_count_add+0x49/0xa0
       ? try_module_get+0x61/0xf0
       ? crypto_mod_get+0x15/0x30
       ? __kmalloc+0x1df/0x1f0
       ? __crypto_alloc_tfm+0x116/0x180
       ? crypto_skcipher_init_tfm+0xa6/0x180
       ? crypto_create_tfm+0x4b/0xf0
       test_skcipher+0x21/0xa0
       alg_test_skcipher+0x3f/0xa0
       alg_test.part.6+0x126/0x2a0
       ? finish_task_switch+0x21b/0x260
       ? __schedule+0x1e9/0x800
       ? __wake_up_common+0x8d/0x140
       cryptomgr_test+0x40/0x50
       kthread+0xff/0x130
       ? cryptomgr_notify+0x540/0x540
       ? kthread_create_on_node+0x70/0x70
       ret_from_fork+0x24/0x50
      
      Fixes: ed8ccaef ("crypto: qat - Add support for SRIOV")
      Cc: stable@vger.kernel.org
      Signed-off-by: NAlexander Sverdlin <alexander.sverdlin@nokia.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9349108a
  8. 08 10月, 2019 1 次提交
    • Y
      crypto: hisilicon - Fix double free in sec_free_hw_sgl() · d983182d
      Yunfeng Ye 提交于
      [ Upstream commit 24fbf7bad888767bed952f540ac963bc57e47e15 ]
      
      There are two problems in sec_free_hw_sgl():
      
      First, when sgl_current->next is valid, @hw_sgl will be freed in the
      first loop, but it free again after the loop.
      
      Second, sgl_current and sgl_current->next_sgl is not match when
      dma_pool_free() is invoked, the third parameter should be the dma
      address of sgl_current, but sgl_current->next_sgl is the dma address
      of next chain, so use sgl_current->next_sgl is wrong.
      
      Fix this by deleting the last dma_pool_free() in sec_free_hw_sgl(),
      modifying the condition for while loop, and matching the address for
      dma_pool_free().
      
      Fixes: 915e4e84 ("crypto: hisilicon - SEC security accelerator driver")
      Signed-off-by: NYunfeng Ye <yeyunfeng@huawei.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      d983182d
  9. 01 10月, 2019 1 次提交
  10. 19 9月, 2019 6 次提交
  11. 16 9月, 2019 2 次提交
  12. 06 9月, 2019 1 次提交
  13. 16 8月, 2019 3 次提交
  14. 26 7月, 2019 8 次提交