1. 22 9月, 2017 1 次提交
  2. 22 8月, 2017 1 次提交
  3. 20 6月, 2017 1 次提交
  4. 10 6月, 2017 1 次提交
  5. 24 4月, 2017 1 次提交
  6. 09 3月, 2017 1 次提交
  7. 01 3月, 2017 1 次提交
    • L
      crypto: testmgr - Pad aes_ccm_enc_tv_template vector · 1c68bb0f
      Laura Abbott 提交于
      Running with KASAN and crypto tests currently gives
      
       BUG: KASAN: global-out-of-bounds in __test_aead+0x9d9/0x2200 at addr ffffffff8212fca0
       Read of size 16 by task cryptomgr_test/1107
       Address belongs to variable 0xffffffff8212fca0
       CPU: 0 PID: 1107 Comm: cryptomgr_test Not tainted 4.10.0+ #45
       Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.9.1-1.fc24 04/01/2014
       Call Trace:
        dump_stack+0x63/0x8a
        kasan_report.part.1+0x4a7/0x4e0
        ? __test_aead+0x9d9/0x2200
        ? crypto_ccm_init_crypt+0x218/0x3c0 [ccm]
        kasan_report+0x20/0x30
        check_memory_region+0x13c/0x1a0
        memcpy+0x23/0x50
        __test_aead+0x9d9/0x2200
        ? kasan_unpoison_shadow+0x35/0x50
        ? alg_test_akcipher+0xf0/0xf0
        ? crypto_skcipher_init_tfm+0x2e3/0x310
        ? crypto_spawn_tfm2+0x37/0x60
        ? crypto_ccm_init_tfm+0xa9/0xd0 [ccm]
        ? crypto_aead_init_tfm+0x7b/0x90
        ? crypto_alloc_tfm+0xc4/0x190
        test_aead+0x28/0xc0
        alg_test_aead+0x54/0xd0
        alg_test+0x1eb/0x3d0
        ? alg_find_test+0x90/0x90
        ? __sched_text_start+0x8/0x8
        ? __wake_up_common+0x70/0xb0
        cryptomgr_test+0x4d/0x60
        kthread+0x173/0x1c0
        ? crypto_acomp_scomp_free_ctx+0x60/0x60
        ? kthread_create_on_node+0xa0/0xa0
        ret_from_fork+0x2c/0x40
       Memory state around the buggy address:
        ffffffff8212fb80: 00 00 00 00 01 fa fa fa fa fa fa fa 00 00 00 00
        ffffffff8212fc00: 00 01 fa fa fa fa fa fa 00 00 00 00 01 fa fa fa
       >ffffffff8212fc80: fa fa fa fa 00 05 fa fa fa fa fa fa 00 00 00 00
                                         ^
        ffffffff8212fd00: 01 fa fa fa fa fa fa fa 00 00 00 00 01 fa fa fa
        ffffffff8212fd80: fa fa fa fa 00 00 00 00 00 05 fa fa fa fa fa fa
      
      This always happens on the same IV which is less than 16 bytes.
      
      Per Ard,
      
      "CCM IVs are 16 bytes, but due to the way they are constructed
      internally, the final couple of bytes of input IV are dont-cares.
      
      Apparently, we do read all 16 bytes, which triggers the KASAN errors."
      
      Fix this by padding the IV with null bytes to be at least 16 bytes.
      
      Cc: stable@vger.kernel.org
      Fixes: 0bc5a6c5 ("crypto: testmgr - Disable rfc4309 test and convert
      test vectors")
      Acked-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NLaura Abbott <labbott@redhat.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      1c68bb0f
  8. 25 2月, 2017 1 次提交
  9. 11 2月, 2017 1 次提交
  10. 13 1月, 2017 1 次提交
    • A
      crypto: testmgr - use calculated count for number of test vectors · 21c8e720
      Ard Biesheuvel 提交于
      When working on AES in CCM mode for ARM, my code passed the internal
      tcrypt test before I had even bothered to implement the AES-192 and
      AES-256 code paths, which is strange because the tcrypt does contain
      AES-192 and AES-256 test vectors for CCM.
      
      As it turned out, the define AES_CCM_ENC_TEST_VECTORS was out of sync
      with the actual number of test vectors, causing only the AES-128 ones
      to be executed.
      
      So get rid of the defines, and wrap the test vector references in a
      macro that calculates the number of vectors automatically.
      
      The following test vector counts were out of sync with the respective
      defines:
      
          BF_CTR_ENC_TEST_VECTORS          2 ->  3
          BF_CTR_DEC_TEST_VECTORS          2 ->  3
          TF_CTR_ENC_TEST_VECTORS          2 ->  3
          TF_CTR_DEC_TEST_VECTORS          2 ->  3
          SERPENT_CTR_ENC_TEST_VECTORS     2 ->  3
          SERPENT_CTR_DEC_TEST_VECTORS     2 ->  3
          AES_CCM_ENC_TEST_VECTORS         8 -> 14
          AES_CCM_DEC_TEST_VECTORS         7 -> 17
          AES_CCM_4309_ENC_TEST_VECTORS    7 -> 23
          AES_CCM_4309_DEC_TEST_VECTORS   10 -> 23
          CAMELLIA_CTR_ENC_TEST_VECTORS    2 ->  3
          CAMELLIA_CTR_DEC_TEST_VECTORS    2 ->  3
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      21c8e720
  11. 07 12月, 2016 1 次提交
  12. 31 8月, 2016 1 次提交
  13. 05 7月, 2016 1 次提交
  14. 01 7月, 2016 1 次提交
  15. 23 6月, 2016 2 次提交
  16. 20 6月, 2016 1 次提交
  17. 27 1月, 2016 1 次提交
  18. 15 10月, 2015 2 次提交
  19. 14 10月, 2015 1 次提交
  20. 04 8月, 2015 1 次提交
  21. 17 7月, 2015 3 次提交
  22. 14 7月, 2015 1 次提交
  23. 07 7月, 2015 1 次提交
  24. 17 6月, 2015 4 次提交
  25. 09 6月, 2015 1 次提交
  26. 04 6月, 2015 4 次提交
  27. 25 5月, 2015 1 次提交
  28. 11 5月, 2015 1 次提交
  29. 01 5月, 2015 2 次提交
    • D
      crypto: testmgr - Wrap the LHS in expressions of the form !x == y · 09e21784
      David Howells 提交于
      In the test manager, there are a number of if-statements with expressions of
      the form !x == y that incur warnings with gcc-5 of the following form:
      
      ../crypto/testmgr.c: In function '__test_aead':
      ../crypto/testmgr.c:523:12: warning: logical not is only applied to the left hand side of comparison [-Wlogical-not-parentheses]
         if (!ret == template[i].fail) {
                  ^
      
      By converting the 'fail' member of struct aead_testvec and struct
      cipher_testvec to a bool, we can get rid of the warnings.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      09e21784
    • D
      crypto: pcomp - Constify (de)compression parameters · f94a3597
      David Howells 提交于
      In testmgr, struct pcomp_testvec takes a non-const 'params' field, which is
      pointed to a const deflate_comp_params or deflate_decomp_params object.  With
      gcc-5 this incurs the following warnings:
      
      In file included from ../crypto/testmgr.c:44:0:
      ../crypto/testmgr.h:28736:13: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-array-qualifiers]
         .params = &deflate_comp_params,
                   ^
      ../crypto/testmgr.h:28748:13: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-array-qualifiers]
         .params = &deflate_comp_params,
                   ^
      ../crypto/testmgr.h:28776:13: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-array-qualifiers]
         .params = &deflate_decomp_params,
                   ^
      ../crypto/testmgr.h:28800:13: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-array-qualifiers]
         .params = &deflate_decomp_params,
                   ^
      
      Fix this by making the parameters pointer const and constifying the things
      that use it.
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      f94a3597