Skip to content

Commit 6f69c98

Browse files
committed
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()
2 parents 63342b1 + b8969a1 commit 6f69c98

File tree

12 files changed

+16
-13
lines changed

12 files changed

+16
-13
lines changed

crypto/acompress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ static const struct crypto_type crypto_acomp_type = {
125125
#ifdef CONFIG_PROC_FS
126126
.show = crypto_acomp_show,
127127
#endif
128-
#ifdef CONFIG_CRYPTO_USER
128+
#if IS_ENABLED(CONFIG_CRYPTO_USER)
129129
.report = crypto_acomp_report,
130130
#endif
131131
#ifdef CONFIG_CRYPTO_STATS

crypto/aead.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ static const struct crypto_type crypto_aead_type = {
242242
#ifdef CONFIG_PROC_FS
243243
.show = crypto_aead_show,
244244
#endif
245-
#ifdef CONFIG_CRYPTO_USER
245+
#if IS_ENABLED(CONFIG_CRYPTO_USER)
246246
.report = crypto_aead_report,
247247
#endif
248248
#ifdef CONFIG_CRYPTO_STATS

crypto/ahash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ static const struct crypto_type crypto_ahash_type = {
509509
#ifdef CONFIG_PROC_FS
510510
.show = crypto_ahash_show,
511511
#endif
512-
#ifdef CONFIG_CRYPTO_USER
512+
#if IS_ENABLED(CONFIG_CRYPTO_USER)
513513
.report = crypto_ahash_report,
514514
#endif
515515
#ifdef CONFIG_CRYPTO_STATS

crypto/akcipher.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ static const struct crypto_type crypto_akcipher_type = {
9898
#ifdef CONFIG_PROC_FS
9999
.show = crypto_akcipher_show,
100100
#endif
101-
#ifdef CONFIG_CRYPTO_USER
101+
#if IS_ENABLED(CONFIG_CRYPTO_USER)
102102
.report = crypto_akcipher_report,
103103
#endif
104104
#ifdef CONFIG_CRYPTO_STATS

crypto/algapi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,9 @@ EXPORT_SYMBOL_GPL(crypto_enqueue_request);
961961
void crypto_enqueue_request_head(struct crypto_queue *queue,
962962
struct crypto_async_request *request)
963963
{
964+
if (unlikely(queue->qlen >= queue->max_qlen))
965+
queue->backlog = queue->backlog->prev;
966+
964967
queue->qlen++;
965968
list_add(&request->list, &queue->list);
966969
}

crypto/crypto_engine.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ static void crypto_pump_requests(struct crypto_engine *engine,
129129
if (!engine->retry_support)
130130
engine->cur_req = async_req;
131131

132-
if (backlog)
133-
crypto_request_complete(backlog, -EINPROGRESS);
134-
135132
if (engine->busy)
136133
was_busy = true;
137134
else
@@ -217,6 +214,9 @@ static void crypto_pump_requests(struct crypto_engine *engine,
217214
crypto_request_complete(async_req, ret);
218215

219216
retry:
217+
if (backlog)
218+
crypto_request_complete(backlog, -EINPROGRESS);
219+
220220
/* If retry mechanism is supported, send new requests to engine */
221221
if (engine->retry_support) {
222222
spin_lock_irqsave(&engine->queue_lock, flags);

crypto/kpp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static const struct crypto_type crypto_kpp_type = {
9696
#ifdef CONFIG_PROC_FS
9797
.show = crypto_kpp_show,
9898
#endif
99-
#ifdef CONFIG_CRYPTO_USER
99+
#if IS_ENABLED(CONFIG_CRYPTO_USER)
100100
.report = crypto_kpp_report,
101101
#endif
102102
#ifdef CONFIG_CRYPTO_STATS

crypto/rng.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static const struct crypto_type crypto_rng_type = {
118118
#ifdef CONFIG_PROC_FS
119119
.show = crypto_rng_show,
120120
#endif
121-
#ifdef CONFIG_CRYPTO_USER
121+
#if IS_ENABLED(CONFIG_CRYPTO_USER)
122122
.report = crypto_rng_report,
123123
#endif
124124
#ifdef CONFIG_CRYPTO_STATS

crypto/scompress.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ static const struct crypto_type crypto_scomp_type = {
240240
#ifdef CONFIG_PROC_FS
241241
.show = crypto_scomp_show,
242242
#endif
243-
#ifdef CONFIG_CRYPTO_USER
243+
#if IS_ENABLED(CONFIG_CRYPTO_USER)
244244
.report = crypto_scomp_report,
245245
#endif
246246
#ifdef CONFIG_CRYPTO_STATS

crypto/shash.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ static const struct crypto_type crypto_shash_type = {
548548
#ifdef CONFIG_PROC_FS
549549
.show = crypto_shash_show,
550550
#endif
551-
#ifdef CONFIG_CRYPTO_USER
551+
#if IS_ENABLED(CONFIG_CRYPTO_USER)
552552
.report = crypto_shash_report,
553553
#endif
554554
#ifdef CONFIG_CRYPTO_STATS

0 commit comments

Comments
 (0)