Commit 384b0dc4 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

Pull crypto fixes from Herbert Xu:
 "This fixes the following issues:

   - Compiler warning in caam driver that was the last one remaining

   - Do not register aes-xts in caam drivers on unsupported platforms

   - Regression in algif_hash interface that may lead to an oops"

* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: algif_hash - Fix NULL hash crash with shash
  crypto: caam - fix type mismatch warning
  crypto: caam - do not register AES-XTS mode on LP units
parents 67418976 a8348bca
...@@ -214,23 +214,26 @@ static int hash_recvmsg(struct socket *sock, struct msghdr *msg, size_t len, ...@@ -214,23 +214,26 @@ static int hash_recvmsg(struct socket *sock, struct msghdr *msg, size_t len,
ahash_request_set_crypt(&ctx->req, NULL, ctx->result, 0); ahash_request_set_crypt(&ctx->req, NULL, ctx->result, 0);
if (ctx->more) { if (!result) {
err = af_alg_wait_for_completion(
crypto_ahash_init(&ctx->req),
&ctx->completion);
if (err)
goto unlock;
}
if (!result || ctx->more) {
ctx->more = 0; ctx->more = 0;
err = af_alg_wait_for_completion(crypto_ahash_final(&ctx->req), err = af_alg_wait_for_completion(crypto_ahash_final(&ctx->req),
&ctx->completion); &ctx->completion);
if (err) if (err)
goto unlock; goto unlock;
} else if (!result) {
err = af_alg_wait_for_completion(
crypto_ahash_digest(&ctx->req),
&ctx->completion);
} }
err = memcpy_to_msg(msg, ctx->result, len); err = memcpy_to_msg(msg, ctx->result, len);
hash_free_result(sk, ctx);
unlock: unlock:
hash_free_result(sk, ctx);
release_sock(sk); release_sock(sk);
return err ?: len; return err ?: len;
......
...@@ -137,7 +137,7 @@ static void dbg_dump_sg(const char *level, const char *prefix_str, ...@@ -137,7 +137,7 @@ static void dbg_dump_sg(const char *level, const char *prefix_str,
} }
buf = it_page + it->offset; buf = it_page + it->offset;
len = min(tlen, it->length); len = min_t(size_t, tlen, it->length);
print_hex_dump(level, prefix_str, prefix_type, rowsize, print_hex_dump(level, prefix_str, prefix_type, rowsize,
groupsize, buf, len, ascii); groupsize, buf, len, ascii);
tlen -= len; tlen -= len;
...@@ -4583,6 +4583,15 @@ static int __init caam_algapi_init(void) ...@@ -4583,6 +4583,15 @@ static int __init caam_algapi_init(void)
if (!aes_inst && (alg_sel == OP_ALG_ALGSEL_AES)) if (!aes_inst && (alg_sel == OP_ALG_ALGSEL_AES))
continue; continue;
/*
* Check support for AES modes not available
* on LP devices.
*/
if ((cha_vid & CHA_ID_LS_AES_MASK) == CHA_ID_LS_AES_LP)
if ((alg->class1_alg_type & OP_ALG_AAI_MASK) ==
OP_ALG_AAI_XTS)
continue;
t_alg = caam_alg_alloc(alg); t_alg = caam_alg_alloc(alg);
if (IS_ERR(t_alg)) { if (IS_ERR(t_alg)) {
err = PTR_ERR(t_alg); err = PTR_ERR(t_alg);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment