Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Sat, 23 Jun 2018 22:31:54 +0000 (06:31 +0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 23 Jun 2018 22:31:54 +0000 (06:31 +0800)
Pull crypto fixes from Herbert Xu:

 - Fix use after free in chtls

 - Fix RBP breakage in sha3

 - Fix use after free in hwrng_unregister

 - Fix overread in morus640

 - Move sleep out of kernel_neon in arm64/aes-blk

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  hwrng: core - Always drop the RNG in hwrng_unregister()
  crypto: morus640 - Fix out-of-bounds access
  crypto: don't optimize keccakf()
  crypto: arm64/aes-blk - fix and move skcipher_walk_done out of kernel_neon_begin, _end
  crypto: chtls - use after free in chtls_pt_recvmsg()

1  2 
drivers/crypto/chelsio/chtls/chtls_io.c

index 00c7aab8e7d0f5861e778dc4d26affe5c1234603,708e232e3cdf7f037720e747ded9f84a4ae1871c..afebbd87c4aa1d22ca179f558552cb2f410fcc0a
@@@ -240,7 -240,7 +240,7 @@@ static int tls_copy_ivs(struct sock *sk
        }
  
        /* generate the  IVs */
 -      ivs = kmalloc(number_of_ivs * CIPHER_BLOCK_SIZE, GFP_ATOMIC);
 +      ivs = kmalloc_array(CIPHER_BLOCK_SIZE, number_of_ivs, GFP_ATOMIC);
        if (!ivs)
                return -ENOMEM;
        get_random_bytes(ivs, number_of_ivs * CIPHER_BLOCK_SIZE);
@@@ -1548,15 -1548,14 +1548,14 @@@ skip_copy
                        tp->urg_data = 0;
  
                if ((avail + offset) >= skb->len) {
-                       if (likely(skb))
-                               chtls_free_skb(sk, skb);
-                       buffers_freed++;
                        if (ULP_SKB_CB(skb)->flags & ULPCB_FLAG_TLS_HDR) {
                                tp->copied_seq += skb->len;
                                hws->rcvpld = skb->hdr_len;
                        } else {
                                tp->copied_seq += hws->rcvpld;
                        }
+                       chtls_free_skb(sk, skb);
+                       buffers_freed++;
                        hws->copied_seq = 0;
                        if (copied >= target &&
                            !skb_peek(&sk->sk_receive_queue))