Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 15 Apr 2016 01:15:40 +0000 (18:15 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 15 Apr 2016 01:15:40 +0000 (18:15 -0700)
Pull crypto fixes from Herbert Xu:
 "This fixes an NFS regression caused by the skcipher/hash conversion in
  sunrpc.  It also fixes a build problem in certain configurations with
  bcm63xx"

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  hwrng: bcm63xx - fix device tree compilation
  sunrpc: Fix skcipher/shash conversion

1  2 
net/sunrpc/auth_gss/gss_krb5_crypto.c

index 045e11ecd332d0f811fbdd34cb15162cd5bff12f,da26455cf86c0e6ff178eb1d6b3564af21220a61..244245bcbbd25554938ab099137799d47ef6791b
@@@ -78,6 -78,7 +78,7 @@@ krb5_encrypt
        memcpy(out, in, length);
        sg_init_one(sg, out, length);
  
+       skcipher_request_set_tfm(req, tfm);
        skcipher_request_set_callback(req, 0, NULL, NULL);
        skcipher_request_set_crypt(req, sg, sg, length, local_iv);
  
@@@ -115,6 -116,7 +116,7 @@@ krb5_decrypt
        memcpy(out, in, length);
        sg_init_one(sg, out, length);
  
+       skcipher_request_set_tfm(req, tfm);
        skcipher_request_set_callback(req, 0, NULL, NULL);
        skcipher_request_set_crypt(req, sg, sg, length, local_iv);
  
@@@ -465,7 -467,7 +467,7 @@@ encryptor(struct scatterlist *sg, void 
        page_pos = desc->pos - outbuf->head[0].iov_len;
        if (page_pos >= 0 && page_pos < outbuf->page_len) {
                /* pages are not in place: */
 -              int i = (page_pos + outbuf->page_base) >> PAGE_CACHE_SHIFT;
 +              int i = (page_pos + outbuf->page_base) >> PAGE_SHIFT;
                in_page = desc->pages[i];
        } else {
                in_page = sg_page(sg);
@@@ -946,7 -948,8 +948,8 @@@ krb5_rc4_setup_seq_key(struct krb5_ctx 
                return PTR_ERR(hmac);
        }
  
-       desc = kmalloc(sizeof(*desc), GFP_KERNEL);
+       desc = kmalloc(sizeof(*desc) + crypto_shash_descsize(hmac),
+                      GFP_KERNEL);
        if (!desc) {
                dprintk("%s: failed to allocate shash descriptor for '%s'\n",
                        __func__, kctx->gk5e->cksum_name);
@@@ -1012,7 -1015,8 +1015,8 @@@ krb5_rc4_setup_enc_key(struct krb5_ctx 
                return PTR_ERR(hmac);
        }
  
-       desc = kmalloc(sizeof(*desc), GFP_KERNEL);
+       desc = kmalloc(sizeof(*desc) + crypto_shash_descsize(hmac),
+                      GFP_KERNEL);
        if (!desc) {
                dprintk("%s: failed to allocate shash descriptor for '%s'\n",
                        __func__, kctx->gk5e->cksum_name);