Commit 6f69c981 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'v6.4-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

Pull crypto fixes from Herbert Xu:

 - A long-standing bug in crypto_engine

 - A buggy but harmless check in the sun8i-ss driver

 - A regression in the CRYPTO_USER interface

* tag 'v6.4-p2' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: api - Fix CRYPTO_USER checks for report function
  crypto: engine - fix crypto_queue backlog handling
  crypto: sun8i-ss - Fix a test in sun8i_ss_setup_ivs()
parents 63342b1d b8969a1b
...@@ -125,7 +125,7 @@ static const struct crypto_type crypto_acomp_type = { ...@@ -125,7 +125,7 @@ static const struct crypto_type crypto_acomp_type = {
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
.show = crypto_acomp_show, .show = crypto_acomp_show,
#endif #endif
#ifdef CONFIG_CRYPTO_USER #if IS_ENABLED(CONFIG_CRYPTO_USER)
.report = crypto_acomp_report, .report = crypto_acomp_report,
#endif #endif
#ifdef CONFIG_CRYPTO_STATS #ifdef CONFIG_CRYPTO_STATS
......
...@@ -242,7 +242,7 @@ static const struct crypto_type crypto_aead_type = { ...@@ -242,7 +242,7 @@ static const struct crypto_type crypto_aead_type = {
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
.show = crypto_aead_show, .show = crypto_aead_show,
#endif #endif
#ifdef CONFIG_CRYPTO_USER #if IS_ENABLED(CONFIG_CRYPTO_USER)
.report = crypto_aead_report, .report = crypto_aead_report,
#endif #endif
#ifdef CONFIG_CRYPTO_STATS #ifdef CONFIG_CRYPTO_STATS
......
...@@ -509,7 +509,7 @@ static const struct crypto_type crypto_ahash_type = { ...@@ -509,7 +509,7 @@ static const struct crypto_type crypto_ahash_type = {
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
.show = crypto_ahash_show, .show = crypto_ahash_show,
#endif #endif
#ifdef CONFIG_CRYPTO_USER #if IS_ENABLED(CONFIG_CRYPTO_USER)
.report = crypto_ahash_report, .report = crypto_ahash_report,
#endif #endif
#ifdef CONFIG_CRYPTO_STATS #ifdef CONFIG_CRYPTO_STATS
......
...@@ -98,7 +98,7 @@ static const struct crypto_type crypto_akcipher_type = { ...@@ -98,7 +98,7 @@ static const struct crypto_type crypto_akcipher_type = {
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
.show = crypto_akcipher_show, .show = crypto_akcipher_show,
#endif #endif
#ifdef CONFIG_CRYPTO_USER #if IS_ENABLED(CONFIG_CRYPTO_USER)
.report = crypto_akcipher_report, .report = crypto_akcipher_report,
#endif #endif
#ifdef CONFIG_CRYPTO_STATS #ifdef CONFIG_CRYPTO_STATS
......
...@@ -961,6 +961,9 @@ EXPORT_SYMBOL_GPL(crypto_enqueue_request); ...@@ -961,6 +961,9 @@ EXPORT_SYMBOL_GPL(crypto_enqueue_request);
void crypto_enqueue_request_head(struct crypto_queue *queue, void crypto_enqueue_request_head(struct crypto_queue *queue,
struct crypto_async_request *request) struct crypto_async_request *request)
{ {
if (unlikely(queue->qlen >= queue->max_qlen))
queue->backlog = queue->backlog->prev;
queue->qlen++; queue->qlen++;
list_add(&request->list, &queue->list); list_add(&request->list, &queue->list);
} }
......
...@@ -129,9 +129,6 @@ static void crypto_pump_requests(struct crypto_engine *engine, ...@@ -129,9 +129,6 @@ static void crypto_pump_requests(struct crypto_engine *engine,
if (!engine->retry_support) if (!engine->retry_support)
engine->cur_req = async_req; engine->cur_req = async_req;
if (backlog)
crypto_request_complete(backlog, -EINPROGRESS);
if (engine->busy) if (engine->busy)
was_busy = true; was_busy = true;
else else
...@@ -217,6 +214,9 @@ static void crypto_pump_requests(struct crypto_engine *engine, ...@@ -217,6 +214,9 @@ static void crypto_pump_requests(struct crypto_engine *engine,
crypto_request_complete(async_req, ret); crypto_request_complete(async_req, ret);
retry: retry:
if (backlog)
crypto_request_complete(backlog, -EINPROGRESS);
/* If retry mechanism is supported, send new requests to engine */ /* If retry mechanism is supported, send new requests to engine */
if (engine->retry_support) { if (engine->retry_support) {
spin_lock_irqsave(&engine->queue_lock, flags); spin_lock_irqsave(&engine->queue_lock, flags);
......
...@@ -96,7 +96,7 @@ static const struct crypto_type crypto_kpp_type = { ...@@ -96,7 +96,7 @@ static const struct crypto_type crypto_kpp_type = {
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
.show = crypto_kpp_show, .show = crypto_kpp_show,
#endif #endif
#ifdef CONFIG_CRYPTO_USER #if IS_ENABLED(CONFIG_CRYPTO_USER)
.report = crypto_kpp_report, .report = crypto_kpp_report,
#endif #endif
#ifdef CONFIG_CRYPTO_STATS #ifdef CONFIG_CRYPTO_STATS
......
...@@ -118,7 +118,7 @@ static const struct crypto_type crypto_rng_type = { ...@@ -118,7 +118,7 @@ static const struct crypto_type crypto_rng_type = {
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
.show = crypto_rng_show, .show = crypto_rng_show,
#endif #endif
#ifdef CONFIG_CRYPTO_USER #if IS_ENABLED(CONFIG_CRYPTO_USER)
.report = crypto_rng_report, .report = crypto_rng_report,
#endif #endif
#ifdef CONFIG_CRYPTO_STATS #ifdef CONFIG_CRYPTO_STATS
......
...@@ -240,7 +240,7 @@ static const struct crypto_type crypto_scomp_type = { ...@@ -240,7 +240,7 @@ static const struct crypto_type crypto_scomp_type = {
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
.show = crypto_scomp_show, .show = crypto_scomp_show,
#endif #endif
#ifdef CONFIG_CRYPTO_USER #if IS_ENABLED(CONFIG_CRYPTO_USER)
.report = crypto_scomp_report, .report = crypto_scomp_report,
#endif #endif
#ifdef CONFIG_CRYPTO_STATS #ifdef CONFIG_CRYPTO_STATS
......
...@@ -548,7 +548,7 @@ static const struct crypto_type crypto_shash_type = { ...@@ -548,7 +548,7 @@ static const struct crypto_type crypto_shash_type = {
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
.show = crypto_shash_show, .show = crypto_shash_show,
#endif #endif
#ifdef CONFIG_CRYPTO_USER #if IS_ENABLED(CONFIG_CRYPTO_USER)
.report = crypto_shash_report, .report = crypto_shash_report,
#endif #endif
#ifdef CONFIG_CRYPTO_STATS #ifdef CONFIG_CRYPTO_STATS
......
...@@ -776,7 +776,7 @@ static const struct crypto_type crypto_skcipher_type = { ...@@ -776,7 +776,7 @@ static const struct crypto_type crypto_skcipher_type = {
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
.show = crypto_skcipher_show, .show = crypto_skcipher_show,
#endif #endif
#ifdef CONFIG_CRYPTO_USER #if IS_ENABLED(CONFIG_CRYPTO_USER)
.report = crypto_skcipher_report, .report = crypto_skcipher_report,
#endif #endif
#ifdef CONFIG_CRYPTO_STATS #ifdef CONFIG_CRYPTO_STATS
......
...@@ -151,7 +151,7 @@ static int sun8i_ss_setup_ivs(struct skcipher_request *areq) ...@@ -151,7 +151,7 @@ static int sun8i_ss_setup_ivs(struct skcipher_request *areq)
} }
rctx->p_iv[i] = a; rctx->p_iv[i] = a;
/* we need to setup all others IVs only in the decrypt way */ /* we need to setup all others IVs only in the decrypt way */
if (rctx->op_dir & SS_ENCRYPTION) if (rctx->op_dir == SS_ENCRYPTION)
return 0; return 0;
todo = min(len, sg_dma_len(sg)); todo = min(len, sg_dma_len(sg));
len -= todo; len -= todo;
......
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