]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 4 Mar 2017 18:42:53 +0000 (10:42 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 4 Mar 2017 18:42:53 +0000 (10:42 -0800)
Pull crypto fixes from Herbert Xu:

 - vmalloc stack regression in CCM

 - Build problem in CRC32 on ARM

 - Memory leak in cavium

 - Missing Kconfig dependencies in atmel and mediatek

 - XTS Regression on some platforms (s390 and ppc)

 - Memory overrun in CCM test vector

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: vmx - Use skcipher for xts fallback
  crypto: vmx - Use skcipher for cbc fallback
  crypto: testmgr - Pad aes_ccm_enc_tv_template vector
  crypto: arm/crc32 - add build time test for CRC instruction support
  crypto: arm/crc32 - fix build error with outdated binutils
  crypto: ccm - move cbcmac input off the stack
  crypto: xts - Propagate NEED_FALLBACK bit
  crypto: api - Add crypto_requires_off helper
  crypto: atmel - CRYPTO_DEV_MEDIATEK should depend on HAS_DMA
  crypto: atmel - CRYPTO_DEV_ATMEL_TDES and CRYPTO_DEV_ATMEL_SHA should depend on HAS_DMA
  crypto: cavium - fix leak on curr if curr->head fails to be allocated
  crypto: cavium - Fix couple of static checker errors

1  2 
crypto/testmgr.h
drivers/crypto/Kconfig

diff --combined crypto/testmgr.h
index 006ecc434351808382b6fbb16c751ca16817c289,663f034c89b935b3f71e94a56d2f273a0246f49d..03f473116f78769af0434366387b3ca8f7a72db4
@@@ -22691,7 -22691,7 +22691,7 @@@ static struct aead_testvec aes_ccm_enc_
                          "\x09\x75\x9a\x9b\x3c\x9b\x27\x39",
                .klen   = 32,
                .iv     = "\x03\xf9\xd9\x4e\x63\xb5\x3d\x9d"
-                         "\x43\xf6\x1e\x50",
+                         "\x43\xf6\x1e\x50\0\0\0\0",
                .assoc  = "\x57\xf5\x6b\x8b\x57\x5c\x3d\x3b"
                          "\x13\x02\x01\x0c\x83\x4c\x96\x35"
                          "\x8e\xd6\x39\xcf\x7d\x14\x9b\x94"
@@@ -34293,123 -34293,61 +34293,123 @@@ static struct hash_testvec bfin_crc_tv_
  
  static struct comp_testvec lz4_comp_tv_template[] = {
        {
 -              .inlen  = 70,
 -              .outlen = 45,
 -              .input  = "Join us now and share the software "
 -                        "Join us now and share the software ",
 -              .output = "\xf0\x10\x4a\x6f\x69\x6e\x20\x75"
 -                        "\x73\x20\x6e\x6f\x77\x20\x61\x6e"
 -                        "\x64\x20\x73\x68\x61\x72\x65\x20"
 -                        "\x74\x68\x65\x20\x73\x6f\x66\x74"
 -                        "\x77\x0d\x00\x0f\x23\x00\x0b\x50"
 -                        "\x77\x61\x72\x65\x20",
 +              .inlen  = 255,
 +              .outlen = 218,
 +              .input  = "LZ4 is lossless compression algorithm, providing"
 +                       " compression speed at 400 MB/s per core, scalable "
 +                       "with multi-cores CPU. It features an extremely fast "
 +                       "decoder, with speed in multiple GB/s per core, "
 +                       "typically reaching RAM speed limits on multi-core "
 +                       "systems.",
 +              .output = "\xf9\x21\x4c\x5a\x34\x20\x69\x73\x20\x6c\x6f\x73\x73"
 +                        "\x6c\x65\x73\x73\x20\x63\x6f\x6d\x70\x72\x65\x73\x73"
 +                        "\x69\x6f\x6e\x20\x61\x6c\x67\x6f\x72\x69\x74\x68\x6d"
 +                        "\x2c\x20\x70\x72\x6f\x76\x69\x64\x69\x6e\x67\x21\x00"
 +                        "\xf0\x21\x73\x70\x65\x65\x64\x20\x61\x74\x20\x34\x30"
 +                        "\x30\x20\x4d\x42\x2f\x73\x20\x70\x65\x72\x20\x63\x6f"
 +                        "\x72\x65\x2c\x20\x73\x63\x61\x6c\x61\x62\x6c\x65\x20"
 +                        "\x77\x69\x74\x68\x20\x6d\x75\x6c\x74\x69\x2d\x1a\x00"
 +                        "\xf0\x00\x73\x20\x43\x50\x55\x2e\x20\x49\x74\x20\x66"
 +                        "\x65\x61\x74\x75\x11\x00\xf2\x0b\x61\x6e\x20\x65\x78"
 +                        "\x74\x72\x65\x6d\x65\x6c\x79\x20\x66\x61\x73\x74\x20"
 +                        "\x64\x65\x63\x6f\x64\x65\x72\x2c\x3d\x00\x02\x67\x00"
 +                        "\x22\x69\x6e\x46\x00\x5a\x70\x6c\x65\x20\x47\x6c\x00"
 +                        "\xf0\x00\x74\x79\x70\x69\x63\x61\x6c\x6c\x79\x20\x72"
 +                        "\x65\x61\x63\x68\xa7\x00\x33\x52\x41\x4d\x38\x00\x83"
 +                        "\x6c\x69\x6d\x69\x74\x73\x20\x6f\x3f\x00\x01\x85\x00"
 +                        "\x90\x20\x73\x79\x73\x74\x65\x6d\x73\x2e",
 +
        },
  };
  
  static struct comp_testvec lz4_decomp_tv_template[] = {
        {
 -              .inlen  = 45,
 -              .outlen = 70,
 -              .input  = "\xf0\x10\x4a\x6f\x69\x6e\x20\x75"
 -                        "\x73\x20\x6e\x6f\x77\x20\x61\x6e"
 -                        "\x64\x20\x73\x68\x61\x72\x65\x20"
 -                        "\x74\x68\x65\x20\x73\x6f\x66\x74"
 -                        "\x77\x0d\x00\x0f\x23\x00\x0b\x50"
 -                        "\x77\x61\x72\x65\x20",
 -              .output = "Join us now and share the software "
 -                        "Join us now and share the software ",
 +              .inlen  = 218,
 +              .outlen = 255,
 +              .input  = "\xf9\x21\x4c\x5a\x34\x20\x69\x73\x20\x6c\x6f\x73\x73"
 +                        "\x6c\x65\x73\x73\x20\x63\x6f\x6d\x70\x72\x65\x73\x73"
 +                        "\x69\x6f\x6e\x20\x61\x6c\x67\x6f\x72\x69\x74\x68\x6d"
 +                        "\x2c\x20\x70\x72\x6f\x76\x69\x64\x69\x6e\x67\x21\x00"
 +                        "\xf0\x21\x73\x70\x65\x65\x64\x20\x61\x74\x20\x34\x30"
 +                        "\x30\x20\x4d\x42\x2f\x73\x20\x70\x65\x72\x20\x63\x6f"
 +                        "\x72\x65\x2c\x20\x73\x63\x61\x6c\x61\x62\x6c\x65\x20"
 +                        "\x77\x69\x74\x68\x20\x6d\x75\x6c\x74\x69\x2d\x1a\x00"
 +                        "\xf0\x00\x73\x20\x43\x50\x55\x2e\x20\x49\x74\x20\x66"
 +                        "\x65\x61\x74\x75\x11\x00\xf2\x0b\x61\x6e\x20\x65\x78"
 +                        "\x74\x72\x65\x6d\x65\x6c\x79\x20\x66\x61\x73\x74\x20"
 +                        "\x64\x65\x63\x6f\x64\x65\x72\x2c\x3d\x00\x02\x67\x00"
 +                        "\x22\x69\x6e\x46\x00\x5a\x70\x6c\x65\x20\x47\x6c\x00"
 +                        "\xf0\x00\x74\x79\x70\x69\x63\x61\x6c\x6c\x79\x20\x72"
 +                        "\x65\x61\x63\x68\xa7\x00\x33\x52\x41\x4d\x38\x00\x83"
 +                        "\x6c\x69\x6d\x69\x74\x73\x20\x6f\x3f\x00\x01\x85\x00"
 +                        "\x90\x20\x73\x79\x73\x74\x65\x6d\x73\x2e",
 +              .output = "LZ4 is lossless compression algorithm, providing"
 +                       " compression speed at 400 MB/s per core, scalable "
 +                       "with multi-cores CPU. It features an extremely fast "
 +                       "decoder, with speed in multiple GB/s per core, "
 +                       "typically reaching RAM speed limits on multi-core "
 +                       "systems.",
        },
  };
  
  static struct comp_testvec lz4hc_comp_tv_template[] = {
        {
 -              .inlen  = 70,
 -              .outlen = 45,
 -              .input  = "Join us now and share the software "
 -                        "Join us now and share the software ",
 -              .output = "\xf0\x10\x4a\x6f\x69\x6e\x20\x75"
 -                        "\x73\x20\x6e\x6f\x77\x20\x61\x6e"
 -                        "\x64\x20\x73\x68\x61\x72\x65\x20"
 -                        "\x74\x68\x65\x20\x73\x6f\x66\x74"
 -                        "\x77\x0d\x00\x0f\x23\x00\x0b\x50"
 -                        "\x77\x61\x72\x65\x20",
 +              .inlen  = 255,
 +              .outlen = 216,
 +              .input  = "LZ4 is lossless compression algorithm, providing"
 +                       " compression speed at 400 MB/s per core, scalable "
 +                       "with multi-cores CPU. It features an extremely fast "
 +                       "decoder, with speed in multiple GB/s per core, "
 +                       "typically reaching RAM speed limits on multi-core "
 +                       "systems.",
 +              .output = "\xf9\x21\x4c\x5a\x34\x20\x69\x73\x20\x6c\x6f\x73\x73"
 +                        "\x6c\x65\x73\x73\x20\x63\x6f\x6d\x70\x72\x65\x73\x73"
 +                        "\x69\x6f\x6e\x20\x61\x6c\x67\x6f\x72\x69\x74\x68\x6d"
 +                        "\x2c\x20\x70\x72\x6f\x76\x69\x64\x69\x6e\x67\x21\x00"
 +                        "\xf0\x21\x73\x70\x65\x65\x64\x20\x61\x74\x20\x34\x30"
 +                        "\x30\x20\x4d\x42\x2f\x73\x20\x70\x65\x72\x20\x63\x6f"
 +                        "\x72\x65\x2c\x20\x73\x63\x61\x6c\x61\x62\x6c\x65\x20"
 +                        "\x77\x69\x74\x68\x20\x6d\x75\x6c\x74\x69\x2d\x1a\x00"
 +                        "\xf0\x00\x73\x20\x43\x50\x55\x2e\x20\x49\x74\x20\x66"
 +                        "\x65\x61\x74\x75\x11\x00\xf2\x0b\x61\x6e\x20\x65\x78"
 +                        "\x74\x72\x65\x6d\x65\x6c\x79\x20\x66\x61\x73\x74\x20"
 +                        "\x64\x65\x63\x6f\x64\x65\x72\x2c\x3d\x00\x02\x67\x00"
 +                        "\x22\x69\x6e\x46\x00\x5a\x70\x6c\x65\x20\x47\x6c\x00"
 +                        "\xf0\x00\x74\x79\x70\x69\x63\x61\x6c\x6c\x79\x20\x72"
 +                        "\x65\x61\x63\x68\xa7\x00\x33\x52\x41\x4d\x38\x00\x97"
 +                        "\x6c\x69\x6d\x69\x74\x73\x20\x6f\x6e\x85\x00\x90\x20"
 +                        "\x73\x79\x73\x74\x65\x6d\x73\x2e",
 +
        },
  };
  
  static struct comp_testvec lz4hc_decomp_tv_template[] = {
        {
 -              .inlen  = 45,
 -              .outlen = 70,
 -              .input  = "\xf0\x10\x4a\x6f\x69\x6e\x20\x75"
 -                        "\x73\x20\x6e\x6f\x77\x20\x61\x6e"
 -                        "\x64\x20\x73\x68\x61\x72\x65\x20"
 -                        "\x74\x68\x65\x20\x73\x6f\x66\x74"
 -                        "\x77\x0d\x00\x0f\x23\x00\x0b\x50"
 -                        "\x77\x61\x72\x65\x20",
 -              .output = "Join us now and share the software "
 -                        "Join us now and share the software ",
 +              .inlen  = 216,
 +              .outlen = 255,
 +              .input  = "\xf9\x21\x4c\x5a\x34\x20\x69\x73\x20\x6c\x6f\x73\x73"
 +                        "\x6c\x65\x73\x73\x20\x63\x6f\x6d\x70\x72\x65\x73\x73"
 +                        "\x69\x6f\x6e\x20\x61\x6c\x67\x6f\x72\x69\x74\x68\x6d"
 +                        "\x2c\x20\x70\x72\x6f\x76\x69\x64\x69\x6e\x67\x21\x00"
 +                        "\xf0\x21\x73\x70\x65\x65\x64\x20\x61\x74\x20\x34\x30"
 +                        "\x30\x20\x4d\x42\x2f\x73\x20\x70\x65\x72\x20\x63\x6f"
 +                        "\x72\x65\x2c\x20\x73\x63\x61\x6c\x61\x62\x6c\x65\x20"
 +                        "\x77\x69\x74\x68\x20\x6d\x75\x6c\x74\x69\x2d\x1a\x00"
 +                        "\xf0\x00\x73\x20\x43\x50\x55\x2e\x20\x49\x74\x20\x66"
 +                        "\x65\x61\x74\x75\x11\x00\xf2\x0b\x61\x6e\x20\x65\x78"
 +                        "\x74\x72\x65\x6d\x65\x6c\x79\x20\x66\x61\x73\x74\x20"
 +                        "\x64\x65\x63\x6f\x64\x65\x72\x2c\x3d\x00\x02\x67\x00"
 +                        "\x22\x69\x6e\x46\x00\x5a\x70\x6c\x65\x20\x47\x6c\x00"
 +                        "\xf0\x00\x74\x79\x70\x69\x63\x61\x6c\x6c\x79\x20\x72"
 +                        "\x65\x61\x63\x68\xa7\x00\x33\x52\x41\x4d\x38\x00\x97"
 +                        "\x6c\x69\x6d\x69\x74\x73\x20\x6f\x6e\x85\x00\x90\x20"
 +                        "\x73\x79\x73\x74\x65\x6d\x73\x2e",
 +              .output = "LZ4 is lossless compression algorithm, providing"
 +                       " compression speed at 400 MB/s per core, scalable "
 +                       "with multi-cores CPU. It features an extremely fast "
 +                       "decoder, with speed in multiple GB/s per core, "
 +                       "typically reaching RAM speed limits on multi-core "
 +                       "systems.",
        },
  };
  
diff --combined drivers/crypto/Kconfig
index 0b49dbc423e2449545d6a61b6a212454eef64f05,a7ff6e5d0ba92cb76682226bae5aed4c487173ab..473d31288ad86ed7b93a7ed87c07fd5cded87f1f
@@@ -62,32 -62,19 +62,32 @@@ config CRYPTO_DEV_GEOD
          will be called geode-aes.
  
  config ZCRYPT
 -      tristate "Support for PCI-attached cryptographic adapters"
 +      tristate "Support for s390 cryptographic adapters"
        depends on S390
        select HW_RANDOM
        help
 -        Select this option if you want to use a PCI-attached cryptographic
 -        adapter like:
 -        + PCI Cryptographic Accelerator (PCICA)
 -        + PCI Cryptographic Coprocessor (PCICC)
 +        Select this option if you want to enable support for
 +        s390 cryptographic adapters like:
          + PCI-X Cryptographic Coprocessor (PCIXCC)
 -        + Crypto Express2 Coprocessor (CEX2C)
 -        + Crypto Express2 Accelerator (CEX2A)
 -        + Crypto Express3 Coprocessor (CEX3C)
 -        + Crypto Express3 Accelerator (CEX3A)
 +        + Crypto Express 2,3,4 or 5 Coprocessor (CEXxC)
 +        + Crypto Express 2,3,4 or 5 Accelerator (CEXxA)
 +        + Crypto Express 4 or 5 EP11 Coprocessor (CEXxP)
 +
 +config PKEY
 +      tristate "Kernel API for protected key handling"
 +      depends on S390
 +      depends on ZCRYPT
 +      help
 +        With this option enabled the pkey kernel module provides an API
 +        for creation and handling of protected keys. Other parts of the
 +        kernel or userspace applications may use these functions.
 +
 +        Select this option if you want to enable the kernel and userspace
 +        API for proteced key handling.
 +
 +        Please note that creation of protected keys from secure keys
 +        requires to have at least one CEX card in coprocessor mode
 +        available at runtime.
  
  config CRYPTO_SHA1_S390
        tristate "SHA1 digest algorithm"
@@@ -137,7 -124,6 +137,7 @@@ config CRYPTO_AES_S39
        depends on S390
        select CRYPTO_ALGAPI
        select CRYPTO_BLKCIPHER
 +      select PKEY
        help
          This is the s390 hardware accelerated implementation of the
          AES cipher algorithms (FIPS-197).
@@@ -459,6 -445,7 +459,7 @@@ config CRYPTO_DEV_ATMEL_AE
  
  config CRYPTO_DEV_ATMEL_TDES
        tristate "Support for Atmel DES/TDES hw accelerator"
+       depends on HAS_DMA
        depends on ARCH_AT91 || COMPILE_TEST
        select CRYPTO_DES
        select CRYPTO_BLKCIPHER
  
  config CRYPTO_DEV_ATMEL_SHA
        tristate "Support for Atmel SHA hw accelerator"
+       depends on HAS_DMA
        depends on ARCH_AT91 || COMPILE_TEST
        select CRYPTO_HASH
        help
@@@ -583,6 -571,7 +585,7 @@@ config CRYPTO_DEV_ROCKCHI
  
  config CRYPTO_DEV_MEDIATEK
        tristate "MediaTek's EIP97 Cryptographic Engine driver"
+       depends on HAS_DMA
        depends on (ARM && ARCH_MEDIATEK) || COMPILE_TEST
        select CRYPTO_AES
        select CRYPTO_AEAD