Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 24 Feb 2020 19:40:23 +0000 (11:40 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 24 Feb 2020 19:40:23 +0000 (11:40 -0800)
Pull crypto fixes from Herbert Xu:
 "This fixes a Kconfig-related build error and an integer overflow in
  chacha20poly1305"

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: chacha20poly1305 - prevent integer overflow on large input
  tee: amdtee: amdtee depends on CRYPTO_DEV_CCP_DD

drivers/tee/amdtee/Kconfig
lib/crypto/chacha20poly1305.c

index 4e32b6413b41ffefdef8d4abaf93d3a7f5a93097..191f9715fa9afcb3ee98fb2ee509e64a9a448b94 100644 (file)
@@ -3,6 +3,6 @@
 config AMDTEE
        tristate "AMD-TEE"
        default m
-       depends on CRYPTO_DEV_SP_PSP
+       depends on CRYPTO_DEV_SP_PSP && CRYPTO_DEV_CCP_DD
        help
          This implements AMD's Trusted Execution Environment (TEE) driver.
index 6d83cafebc69ce06b3b37b96f665f3537a0748b5..ad0699ce702f954bbae3aa899b7acda21a289fd2 100644 (file)
@@ -235,6 +235,9 @@ bool chacha20poly1305_crypt_sg_inplace(struct scatterlist *src,
                __le64 lens[2];
        } b __aligned(16);
 
+       if (WARN_ON(src_len > INT_MAX))
+               return false;
+
        chacha_load_key(b.k, key);
 
        b.iv[0] = 0;