Commit e43327c7 authored by Linus Torvalds's avatar Linus Torvalds

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
parents dcc5c6f0 c195d66a
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/net.h> #include <linux/net.h>
#include <linux/rwsem.h> #include <linux/rwsem.h>
#include <linux/sched.h>
#include <linux/sched/signal.h> #include <linux/sched/signal.h>
#include <linux/security.h> #include <linux/security.h>
...@@ -845,9 +846,15 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size, ...@@ -845,9 +846,15 @@ int af_alg_sendmsg(struct socket *sock, struct msghdr *msg, size_t size,
} }
lock_sock(sk); lock_sock(sk);
if (ctx->init && (init || !ctx->more)) { if (ctx->init && !ctx->more) {
err = -EINVAL; if (ctx->used) {
goto unlock; err = -EINVAL;
goto unlock;
}
pr_info_once(
"%s sent an empty control message without MSG_MORE.\n",
current->comm);
} }
ctx->init = true; ctx->init = true;
......
...@@ -92,8 +92,7 @@ static int ingenic_rng_probe(struct platform_device *pdev) ...@@ -92,8 +92,7 @@ static int ingenic_rng_probe(struct platform_device *pdev)
priv->base = devm_platform_ioremap_resource(pdev, 0); priv->base = devm_platform_ioremap_resource(pdev, 0);
if (IS_ERR(priv->base)) { if (IS_ERR(priv->base)) {
pr_err("%s: Failed to map RNG registers\n", __func__); pr_err("%s: Failed to map RNG registers\n", __func__);
ret = PTR_ERR(priv->base); return PTR_ERR(priv->base);
goto err_free_rng;
} }
priv->version = (enum ingenic_rng_version)of_device_get_match_data(&pdev->dev); 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) ...@@ -106,17 +105,13 @@ static int ingenic_rng_probe(struct platform_device *pdev)
ret = hwrng_register(&priv->rng); ret = hwrng_register(&priv->rng);
if (ret) { if (ret) {
dev_err(&pdev->dev, "Failed to register hwrng\n"); dev_err(&pdev->dev, "Failed to register hwrng\n");
goto err_free_rng; return ret;
} }
platform_set_drvdata(pdev, priv); platform_set_drvdata(pdev, priv);
dev_info(&pdev->dev, "Ingenic RNG driver registered\n"); dev_info(&pdev->dev, "Ingenic RNG driver registered\n");
return 0; return 0;
err_free_rng:
kfree(priv);
return ret;
} }
static int ingenic_rng_remove(struct platform_device *pdev) static int ingenic_rng_remove(struct platform_device *pdev)
......
...@@ -873,6 +873,9 @@ config CRYPTO_DEV_SA2UL ...@@ -873,6 +873,9 @@ config CRYPTO_DEV_SA2UL
select CRYPTO_AES select CRYPTO_AES
select CRYPTO_AES_ARM64 select CRYPTO_AES_ARM64
select CRYPTO_ALGAPI select CRYPTO_ALGAPI
select CRYPTO_SHA1
select CRYPTO_SHA256
select CRYPTO_SHA512
select HW_RANDOM select HW_RANDOM
select SG_SPLIT select SG_SPLIT
help help
......
...@@ -131,9 +131,10 @@ static int adf_put_admin_msg_sync(struct adf_accel_dev *accel_dev, u32 ae, ...@@ -131,9 +131,10 @@ static int adf_put_admin_msg_sync(struct adf_accel_dev *accel_dev, u32 ae,
memcpy(admin->virt_addr + offset, in, ADF_ADMINMSG_LEN); memcpy(admin->virt_addr + offset, in, ADF_ADMINMSG_LEN);
ADF_CSR_WR(mailbox, mb_offset, 1); ADF_CSR_WR(mailbox, mb_offset, 1);
ret = readl_poll_timeout(mailbox + mb_offset, status, ret = read_poll_timeout(ADF_CSR_RD, status, status == 0,
status == 0, ADF_ADMIN_POLL_DELAY_US, ADF_ADMIN_POLL_DELAY_US,
ADF_ADMIN_POLL_TIMEOUT_US); ADF_ADMIN_POLL_TIMEOUT_US, true,
mailbox, mb_offset);
if (ret < 0) { if (ret < 0) {
/* Response timeout */ /* Response timeout */
dev_err(&GET_DEV(accel_dev), dev_err(&GET_DEV(accel_dev),
......
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