History

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

Linus Torvalds committed 6 years ago

Commit e43327c2 parents dcc5c6f c195d664 files · +19 −13Browse files

Unified · Split

4 files
  1. crypto/af_alg.c +10 −3
  2. drivers/char/hw_random/ingenic-rng.c +2 −7
  3. drivers/crypto/Kconfig +3 −0
  4. drivers/crypto/qat/qat_common/adf_admin.c +4 −3
crypto/af_alg.c+10−3
@@ -16,6 +16,7 @@ · 15 unmodified lines
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, · 823 unmodified lines
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
@@ -92,8 +92,7 @@ static int ingenic_rng_probe(struct platform_device *pdev) · 91 unmodified lines
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) · 6 unmodified lines
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−0
@@ -873,6 +873,9 @@ config CRYPTO_DEV_SA2UL · 872 unmodified lines
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
@@ -131,9 +131,10 @@ static int adf_put_admin_msg_sync(struct adf_accel_dev *accel_dev, u32 ae, · 130 unmodified lines
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),

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t