Skip to content

Commit e43327c

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: - fix regression in af_alg that affects iwd - restore polling delay in qat - fix double free in ingenic on error path - fix potential build failure in sa2ul due to missing Kconfig dependency * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: af_alg - Work around empty control messages without MSG_MORE crypto: sa2ul - add Kconfig selects to fix build error crypto: ingenic - Drop kfree for memory allocated with devm_kzalloc crypto: qat - add delay before polling mailbox
2 parents dcc5c6f + c195d66 commit e43327c

File tree

4 files changed

+19
-13
lines changed

4 files changed

+19
-13
lines changed

crypto/af_alg.c

+10-3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include <linux/module.h>
1717
#include <linux/net.h>
1818
#include <linux/rwsem.h>
19+
#include <linux/sched.h>
1920
#include <linux/sched/signal.h>
2021
#include <linux/security.h>
2122

@@ -845,9 +846,15 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size,
845846
}
846847

847848
lock_sock(sk);
848-
if (ctx->init && (init || !ctx->more)) {
849-
err = -EINVAL;
850-
goto unlock;
849+
if (ctx->init && !ctx->more) {
850+
if (ctx->used) {
851+
err = -EINVAL;
852+
goto unlock;
853+
}
854+
855+
pr_info_once(
856+
"%s sent an empty control message without MSG_MORE.\n",
857+
current->comm);
851858
}
852859
ctx->init = true;
853860

drivers/char/hw_random/ingenic-rng.c

+2-7
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ static int ingenic_rng_probe(struct platform_device *pdev)
9292
priv->base = devm_platform_ioremap_resource(pdev, 0);
9393
if (IS_ERR(priv->base)) {
9494
pr_err("%s: Failed to map RNG registers\n", __func__);
95-
ret = PTR_ERR(priv->base);
96-
goto err_free_rng;
95+
return PTR_ERR(priv->base);
9796
}
9897

9998
priv->version = (enum ingenic_rng_version)of_device_get_match_data(&pdev->dev);
@@ -106,17 +105,13 @@ static int ingenic_rng_probe(struct platform_device *pdev)
106105
ret = hwrng_register(&priv->rng);
107106
if (ret) {
108107
dev_err(&pdev->dev, "Failed to register hwrng\n");
109-
goto err_free_rng;
108+
return ret;
110109
}
111110

112111
platform_set_drvdata(pdev, priv);
113112

114113
dev_info(&pdev->dev, "Ingenic RNG driver registered\n");
115114
return 0;
116-
117-
err_free_rng:
118-
kfree(priv);
119-
return ret;
120115
}
121116

122117
static int ingenic_rng_remove(struct platform_device *pdev)

drivers/crypto/Kconfig

+3
Original file line numberDiff line numberDiff line change
@@ -873,6 +873,9 @@ config CRYPTO_DEV_SA2UL
873873
select CRYPTO_AES
874874
select CRYPTO_AES_ARM64
875875
select CRYPTO_ALGAPI
876+
select CRYPTO_SHA1
877+
select CRYPTO_SHA256
878+
select CRYPTO_SHA512
876879
select HW_RANDOM
877880
select SG_SPLIT
878881
help

drivers/crypto/qat/qat_common/adf_admin.c

+4-3
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,10 @@ static int adf_put_admin_msg_sync(struct adf_accel_dev *accel_dev, u32 ae,
131131
memcpy(admin->virt_addr + offset, in, ADF_ADMINMSG_LEN);
132132
ADF_CSR_WR(mailbox, mb_offset, 1);
133133

134-
ret = readl_poll_timeout(mailbox + mb_offset, status,
135-
status == 0, ADF_ADMIN_POLL_DELAY_US,
136-
ADF_ADMIN_POLL_TIMEOUT_US);
134+
ret = read_poll_timeout(ADF_CSR_RD, status, status == 0,
135+
ADF_ADMIN_POLL_DELAY_US,
136+
ADF_ADMIN_POLL_TIMEOUT_US, true,
137+
mailbox, mb_offset);
137138
if (ret < 0) {
138139
/* Response timeout */
139140
dev_err(&GET_DEV(accel_dev),

0 commit comments

Comments
 (0)