Skip to content

Commit 2c92341

Browse files
committed
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: API: - algif_hash needs to wait for init operations to complete. - The has_key setting for shash was always true. Algorithms: - Add missing selections of CRYPTO_HASH. - Fix pkcs7 authentication. Drivers: - Fix stack alignment bug in chacha20-ssse3. - Fix performance regression in caam due to incorrect setting. - Fix potential compile-only build failure of stm32" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: atmel-aes - remove calls of clk_prepare() from atomic contexts crypto: algif_hash - wait for crypto_ahash_init() to complete crypto: shash - Fix has_key setting hwrng: stm32 - Fix dependencies for !HAS_IOMEM archs crypto: ghash,poly1305 - select CRYPTO_HASH where needed crypto: chacha20-ssse3 - Align stack pointer to 64 bytes PKCS#7: Don't require SpcSpOpusInfo in Authenticode pkcs7 signatures crypto: caam - make write transactions bufferable on PPC platforms
2 parents 29a8ea4 + 49a2045 commit 2c92341

File tree

8 files changed

+28
-16
lines changed

8 files changed

+28
-16
lines changed

arch/x86/crypto/chacha20-ssse3-x86_64.S

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ ENTRY(chacha20_4block_xor_ssse3)
157157
# done with the slightly better performing SSSE3 byte shuffling,
158158
# 7/12-bit word rotation uses traditional shift+OR.
159159

160-
sub $0x40,%rsp
160+
mov %rsp,%r11
161+
sub $0x80,%rsp
162+
and $~63,%rsp
161163

162164
# x0..15[0-3] = s0..3[0..3]
163165
movq 0x00(%rdi),%xmm1
@@ -620,6 +622,6 @@ ENTRY(chacha20_4block_xor_ssse3)
620622
pxor %xmm1,%xmm15
621623
movdqu %xmm15,0xf0(%rsi)
622624

623-
add $0x40,%rsp
625+
mov %r11,%rsp
624626
ret
625627
ENDPROC(chacha20_4block_xor_ssse3)

crypto/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,13 @@ config CRYPTO_CRCT10DIF_PCLMUL
472472
config CRYPTO_GHASH
473473
tristate "GHASH digest algorithm"
474474
select CRYPTO_GF128MUL
475+
select CRYPTO_HASH
475476
help
476477
GHASH is message digest algorithm for GCM (Galois/Counter Mode).
477478

478479
config CRYPTO_POLY1305
479480
tristate "Poly1305 authenticator algorithm"
481+
select CRYPTO_HASH
480482
help
481483
Poly1305 authenticator algorithm, RFC7539.
482484

crypto/algif_hash.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ static int hash_sendmsg(struct socket *sock, struct msghdr *msg,
5454

5555
lock_sock(sk);
5656
if (!ctx->more) {
57-
err = crypto_ahash_init(&ctx->req);
57+
err = af_alg_wait_for_completion(crypto_ahash_init(&ctx->req),
58+
&ctx->completion);
5859
if (err)
5960
goto unlock;
6061
}
@@ -125,6 +126,7 @@ static ssize_t hash_sendpage(struct socket *sock, struct page *page,
125126
} else {
126127
if (!ctx->more) {
127128
err = crypto_ahash_init(&ctx->req);
129+
err = af_alg_wait_for_completion(err, &ctx->completion);
128130
if (err)
129131
goto unlock;
130132
}

crypto/asymmetric_keys/pkcs7_parser.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -547,9 +547,7 @@ int pkcs7_sig_note_set_of_authattrs(void *context, size_t hdrlen,
547547
struct pkcs7_signed_info *sinfo = ctx->sinfo;
548548

549549
if (!test_bit(sinfo_has_content_type, &sinfo->aa_set) ||
550-
!test_bit(sinfo_has_message_digest, &sinfo->aa_set) ||
551-
(ctx->msg->data_type == OID_msIndirectData &&
552-
!test_bit(sinfo_has_ms_opus_info, &sinfo->aa_set))) {
550+
!test_bit(sinfo_has_message_digest, &sinfo->aa_set)) {
553551
pr_warn("Missing required AuthAttr\n");
554552
return -EBADMSG;
555553
}

crypto/shash.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -354,11 +354,10 @@ int crypto_init_shash_ops_async(struct crypto_tfm *tfm)
354354
crt->final = shash_async_final;
355355
crt->finup = shash_async_finup;
356356
crt->digest = shash_async_digest;
357+
crt->setkey = shash_async_setkey;
358+
359+
crt->has_setkey = alg->setkey != shash_no_setkey;
357360

358-
if (alg->setkey) {
359-
crt->setkey = shash_async_setkey;
360-
crt->has_setkey = true;
361-
}
362361
if (alg->export)
363362
crt->export = shash_async_export;
364363
if (alg->import)

drivers/char/hw_random/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,7 @@ config HW_RANDOM_XGENE
372372
config HW_RANDOM_STM32
373373
tristate "STMicroelectronics STM32 random number generator"
374374
depends on HW_RANDOM && (ARCH_STM32 || COMPILE_TEST)
375+
depends on HAS_IOMEM
375376
help
376377
This driver provides kernel-side support for the Random Number
377378
Generator hardware found on STM32 microcontrollers.

drivers/crypto/atmel-aes.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ static int atmel_aes_hw_init(struct atmel_aes_dev *dd)
400400
{
401401
int err;
402402

403-
err = clk_prepare_enable(dd->iclk);
403+
err = clk_enable(dd->iclk);
404404
if (err)
405405
return err;
406406

@@ -430,7 +430,7 @@ static int atmel_aes_hw_version_init(struct atmel_aes_dev *dd)
430430

431431
dev_info(dd->dev, "version: 0x%x\n", dd->hw_version);
432432

433-
clk_disable_unprepare(dd->iclk);
433+
clk_disable(dd->iclk);
434434
return 0;
435435
}
436436

@@ -448,7 +448,7 @@ static inline bool atmel_aes_is_encrypt(const struct atmel_aes_dev *dd)
448448

449449
static inline int atmel_aes_complete(struct atmel_aes_dev *dd, int err)
450450
{
451-
clk_disable_unprepare(dd->iclk);
451+
clk_disable(dd->iclk);
452452
dd->flags &= ~AES_FLAGS_BUSY;
453453

454454
if (dd->is_async)
@@ -2091,10 +2091,14 @@ static int atmel_aes_probe(struct platform_device *pdev)
20912091
goto res_err;
20922092
}
20932093

2094-
err = atmel_aes_hw_version_init(aes_dd);
2094+
err = clk_prepare(aes_dd->iclk);
20952095
if (err)
20962096
goto res_err;
20972097

2098+
err = atmel_aes_hw_version_init(aes_dd);
2099+
if (err)
2100+
goto iclk_unprepare;
2101+
20982102
atmel_aes_get_cap(aes_dd);
20992103

21002104
err = atmel_aes_buff_init(aes_dd);
@@ -2127,6 +2131,8 @@ static int atmel_aes_probe(struct platform_device *pdev)
21272131
err_aes_dma:
21282132
atmel_aes_buff_cleanup(aes_dd);
21292133
err_aes_buff:
2134+
iclk_unprepare:
2135+
clk_unprepare(aes_dd->iclk);
21302136
res_err:
21312137
tasklet_kill(&aes_dd->done_task);
21322138
tasklet_kill(&aes_dd->queue_task);
@@ -2155,6 +2161,8 @@ static int atmel_aes_remove(struct platform_device *pdev)
21552161
atmel_aes_dma_cleanup(aes_dd);
21562162
atmel_aes_buff_cleanup(aes_dd);
21572163

2164+
clk_unprepare(aes_dd->iclk);
2165+
21582166
return 0;
21592167
}
21602168

drivers/crypto/caam/ctrl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,8 @@ static int caam_probe(struct platform_device *pdev)
534534
* long pointers in master configuration register
535535
*/
536536
clrsetbits_32(&ctrl->mcr, MCFGR_AWCACHE_MASK, MCFGR_AWCACHE_CACH |
537-
MCFGR_WDENABLE | (sizeof(dma_addr_t) == sizeof(u64) ?
538-
MCFGR_LONG_PTR : 0));
537+
MCFGR_AWCACHE_BUFF | MCFGR_WDENABLE |
538+
(sizeof(dma_addr_t) == sizeof(u64) ? MCFGR_LONG_PTR : 0));
539539

540540
/*
541541
* Read the Compile Time paramters and SCFGR to determine

0 commit comments

Comments
 (0)