--- a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
+++ b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
-@@ -63,13 +63,13 @@ static int sun4i_ss_opti_poll(struct skc
+@@ -55,13 +55,13 @@ static int sun4i_ss_opti_poll(struct skc
spin_lock_irqsave(&ss->slock, flags);
}
}
writel(mode, ss->base + SS_CTL);
-@@ -223,13 +223,13 @@ static int sun4i_ss_cipher_poll(struct s
+@@ -204,13 +204,13 @@ static int sun4i_ss_cipher_poll(struct s
spin_lock_irqsave(&ss->slock, flags);
+++ /dev/null
-From b756f1c8fc9d84e3f546d7ffe056c5352f4aab05 Mon Sep 17 00:00:00 2001
-From: Corentin Labbe <clabbe@baylibre.com>
-Date: Mon, 14 Dec 2020 20:02:27 +0000
-Subject: crypto: sun4i-ss - IV register does not work on A10 and A13
-
-From: Corentin Labbe <clabbe@baylibre.com>
-
-commit b756f1c8fc9d84e3f546d7ffe056c5352f4aab05 upstream.
-
-Allwinner A10 and A13 SoC have a version of the SS which produce
-invalid IV in IVx register.
-
-Instead of adding a variant for those, let's convert SS to produce IV
-directly from data.
-Fixes: 6298e948215f2 ("crypto: sunxi-ss - Add Allwinner Security System crypto accelerator")
-Cc: <stable@vger.kernel.org>
-Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
-Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- drivers/crypto/sunxi-ss/sun4i-ss-cipher.c | 34 ++++++++++++++++++++++++------
- 1 file changed, 28 insertions(+), 6 deletions(-)
-
---- a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
-+++ b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
-@@ -24,6 +24,7 @@ static int sun4i_ss_opti_poll(struct skc
- unsigned int ivsize = crypto_skcipher_ivsize(tfm);
- struct sun4i_cipher_req_ctx *ctx = skcipher_request_ctx(areq);
- u32 mode = ctx->mode;
-+ void *backup_iv = NULL;
- /* when activating SS, the default FIFO space is SS_RX_DEFAULT(32) */
- u32 rx_cnt = SS_RX_DEFAULT;
- u32 tx_cnt = 0;
-@@ -53,6 +54,13 @@ static int sun4i_ss_opti_poll(struct skc
- return -EINVAL;
- }
-
-+ if (areq->iv && ivsize > 0 && mode & SS_DECRYPTION) {
-+ backup_iv = kzalloc(ivsize, GFP_KERNEL);
-+ if (!backup_iv)
-+ return -ENOMEM;
-+ scatterwalk_map_and_copy(backup_iv, areq->src, areq->cryptlen - ivsize, ivsize, 0);
-+ }
-+
- spin_lock_irqsave(&ss->slock, flags);
-
- for (i = 0; i < op->keylen; i += 4)
-@@ -126,9 +134,12 @@ static int sun4i_ss_opti_poll(struct skc
- } while (oleft);
-
- if (areq->iv) {
-- for (i = 0; i < 4 && i < ivsize / 4; i++) {
-- v = readl(ss->base + SS_IV0 + i * 4);
-- *(u32 *)(areq->iv + i * 4) = v;
-+ if (mode & SS_DECRYPTION) {
-+ memcpy(areq->iv, backup_iv, ivsize);
-+ kfree_sensitive(backup_iv);
-+ } else {
-+ scatterwalk_map_and_copy(areq->iv, areq->dst, areq->cryptlen - ivsize,
-+ ivsize, 0);
- }
- }
-
-@@ -160,6 +171,7 @@ static int sun4i_ss_cipher_poll(struct s
- unsigned int ileft = areq->cryptlen;
- unsigned int oleft = areq->cryptlen;
- unsigned int todo;
-+ void *backup_iv = NULL;
- struct sg_mapping_iter mi, mo;
- unsigned long pi = 0, po = 0; /* progress for in and out */
- bool miter_err;
-@@ -202,6 +214,13 @@ static int sun4i_ss_cipher_poll(struct s
- if (no_chunk == 1)
- return sun4i_ss_opti_poll(areq);
-
-+ if (areq->iv && ivsize > 0 && mode & SS_DECRYPTION) {
-+ backup_iv = kzalloc(ivsize, GFP_KERNEL);
-+ if (!backup_iv)
-+ return -ENOMEM;
-+ scatterwalk_map_and_copy(backup_iv, areq->src, areq->cryptlen - ivsize, ivsize, 0);
-+ }
-+
- spin_lock_irqsave(&ss->slock, flags);
-
- for (i = 0; i < op->keylen; i += 4)
-@@ -330,9 +349,12 @@ static int sun4i_ss_cipher_poll(struct s
- sg_miter_stop(&mo);
- }
- if (areq->iv) {
-- for (i = 0; i < 4 && i < ivsize / 4; i++) {
-- v = readl(ss->base + SS_IV0 + i * 4);
-- *(u32 *)(areq->iv + i * 4) = v;
-+ if (mode & SS_DECRYPTION) {
-+ memcpy(areq->iv, backup_iv, ivsize);
-+ kfree_sensitive(backup_iv);
-+ } else {
-+ scatterwalk_map_and_copy(areq->iv, areq->dst, areq->cryptlen - ivsize,
-+ ivsize, 0);
- }
- }
-
btrfs-fix-reloc-root-leak-with-0-ref-reloc-roots-on-recovery.patch
btrfs-fix-extent-buffer-leak-on-failure-to-copy-root.patch
crypto-sun4i-ss-checking-sg-length-is-not-sufficient.patch
-crypto-sun4i-ss-iv-register-does-not-work-on-a10-and-a13.patch
crypto-sun4i-ss-handle-bigendian-for-cipher.patch
seccomp-add-missing-return-in-non-void-function.patch
drivers-misc-vmw_vmci-restrict-too-big-queue-size-in-qp_host_alloc_queue.patch
--- a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
+++ b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
-@@ -63,13 +63,13 @@ static int sun4i_ss_opti_poll(struct skc
+@@ -55,13 +55,13 @@ static int sun4i_ss_opti_poll(struct skc
spin_lock_irqsave(&ss->slock, flags);
}
}
writel(mode, ss->base + SS_CTL);
-@@ -223,13 +223,13 @@ static int sun4i_ss_cipher_poll(struct s
+@@ -204,13 +204,13 @@ static int sun4i_ss_cipher_poll(struct s
spin_lock_irqsave(&ss->slock, flags);
+++ /dev/null
-From b756f1c8fc9d84e3f546d7ffe056c5352f4aab05 Mon Sep 17 00:00:00 2001
-From: Corentin Labbe <clabbe@baylibre.com>
-Date: Mon, 14 Dec 2020 20:02:27 +0000
-Subject: crypto: sun4i-ss - IV register does not work on A10 and A13
-
-From: Corentin Labbe <clabbe@baylibre.com>
-
-commit b756f1c8fc9d84e3f546d7ffe056c5352f4aab05 upstream.
-
-Allwinner A10 and A13 SoC have a version of the SS which produce
-invalid IV in IVx register.
-
-Instead of adding a variant for those, let's convert SS to produce IV
-directly from data.
-Fixes: 6298e948215f2 ("crypto: sunxi-ss - Add Allwinner Security System crypto accelerator")
-Cc: <stable@vger.kernel.org>
-Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
-Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- drivers/crypto/sunxi-ss/sun4i-ss-cipher.c | 34 ++++++++++++++++++++++++------
- 1 file changed, 28 insertions(+), 6 deletions(-)
-
---- a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
-+++ b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
-@@ -24,6 +24,7 @@ static int sun4i_ss_opti_poll(struct skc
- unsigned int ivsize = crypto_skcipher_ivsize(tfm);
- struct sun4i_cipher_req_ctx *ctx = skcipher_request_ctx(areq);
- u32 mode = ctx->mode;
-+ void *backup_iv = NULL;
- /* when activating SS, the default FIFO space is SS_RX_DEFAULT(32) */
- u32 rx_cnt = SS_RX_DEFAULT;
- u32 tx_cnt = 0;
-@@ -53,6 +54,13 @@ static int sun4i_ss_opti_poll(struct skc
- return -EINVAL;
- }
-
-+ if (areq->iv && ivsize > 0 && mode & SS_DECRYPTION) {
-+ backup_iv = kzalloc(ivsize, GFP_KERNEL);
-+ if (!backup_iv)
-+ return -ENOMEM;
-+ scatterwalk_map_and_copy(backup_iv, areq->src, areq->cryptlen - ivsize, ivsize, 0);
-+ }
-+
- spin_lock_irqsave(&ss->slock, flags);
-
- for (i = 0; i < op->keylen; i += 4)
-@@ -126,9 +134,12 @@ static int sun4i_ss_opti_poll(struct skc
- } while (oleft);
-
- if (areq->iv) {
-- for (i = 0; i < 4 && i < ivsize / 4; i++) {
-- v = readl(ss->base + SS_IV0 + i * 4);
-- *(u32 *)(areq->iv + i * 4) = v;
-+ if (mode & SS_DECRYPTION) {
-+ memcpy(areq->iv, backup_iv, ivsize);
-+ kfree_sensitive(backup_iv);
-+ } else {
-+ scatterwalk_map_and_copy(areq->iv, areq->dst, areq->cryptlen - ivsize,
-+ ivsize, 0);
- }
- }
-
-@@ -160,6 +171,7 @@ static int sun4i_ss_cipher_poll(struct s
- unsigned int ileft = areq->cryptlen;
- unsigned int oleft = areq->cryptlen;
- unsigned int todo;
-+ void *backup_iv = NULL;
- struct sg_mapping_iter mi, mo;
- unsigned long pi = 0, po = 0; /* progress for in and out */
- bool miter_err;
-@@ -202,6 +214,13 @@ static int sun4i_ss_cipher_poll(struct s
- if (no_chunk == 1)
- return sun4i_ss_opti_poll(areq);
-
-+ if (areq->iv && ivsize > 0 && mode & SS_DECRYPTION) {
-+ backup_iv = kzalloc(ivsize, GFP_KERNEL);
-+ if (!backup_iv)
-+ return -ENOMEM;
-+ scatterwalk_map_and_copy(backup_iv, areq->src, areq->cryptlen - ivsize, ivsize, 0);
-+ }
-+
- spin_lock_irqsave(&ss->slock, flags);
-
- for (i = 0; i < op->keylen; i += 4)
-@@ -330,9 +349,12 @@ static int sun4i_ss_cipher_poll(struct s
- sg_miter_stop(&mo);
- }
- if (areq->iv) {
-- for (i = 0; i < 4 && i < ivsize / 4; i++) {
-- v = readl(ss->base + SS_IV0 + i * 4);
-- *(u32 *)(areq->iv + i * 4) = v;
-+ if (mode & SS_DECRYPTION) {
-+ memcpy(areq->iv, backup_iv, ivsize);
-+ kfree_sensitive(backup_iv);
-+ } else {
-+ scatterwalk_map_and_copy(areq->iv, areq->dst, areq->cryptlen - ivsize,
-+ ivsize, 0);
- }
- }
-
btrfs-fix-extent-buffer-leak-on-failure-to-copy-root.patch
crypto-arm64-sha-add-missing-module-aliases.patch
crypto-sun4i-ss-checking-sg-length-is-not-sufficient.patch
-crypto-sun4i-ss-iv-register-does-not-work-on-a10-and-a13.patch
crypto-sun4i-ss-handle-bigendian-for-cipher.patch
seccomp-add-missing-return-in-non-void-function.patch
misc-rtsx-init-of-rts522a-add-ocp-power-off-when-no-card-is-present.patch
+++ /dev/null
-From 42ad28a1036fe03ea783244ef85f6b07280fd19c Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 16 Dec 2020 03:19:46 +0200
-Subject: drm: rcar-du: Fix leak of CMM platform device reference
-
-From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
-
-[ Upstream commit 9fa120458da142da0d1d3eaf6f6a3a2c2c91d27b ]
-
-The device references acquired by of_find_device_by_node() are not
-released by the driver. Fix this by registering a cleanup action.
-
-Fixes: 8de707aeb452 ("drm: rcar-du: kms: Initialize CMM instances")
-Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
-Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/gpu/drm/rcar-du/rcar_du_kms.c | 22 +++++++++++++++++++---
- 1 file changed, 19 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
-index 7015e22872bbe..ecc894f0bc430 100644
---- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c
-+++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
-@@ -14,6 +14,7 @@
- #include <drm/drm_fb_cma_helper.h>
- #include <drm/drm_gem_cma_helper.h>
- #include <drm/drm_gem_framebuffer_helper.h>
-+#include <drm/drm_managed.h>
- #include <drm/drm_probe_helper.h>
- #include <drm/drm_vblank.h>
-
-@@ -726,8 +727,12 @@ static int rcar_du_cmm_init(struct rcar_du_device *rcdu)
- * disabled: return 0 and let the DU continue probing.
- */
- ret = rcar_cmm_init(pdev);
-- if (ret)
-+ if (ret) {
-+ platform_device_put(pdev);
- return ret == -ENODEV ? 0 : ret;
-+ }
-+
-+ rcdu->cmms[i] = pdev;
-
- /*
- * Enforce suspend/resume ordering by making the CMM a provider
-@@ -739,13 +744,20 @@ static int rcar_du_cmm_init(struct rcar_du_device *rcdu)
- "Failed to create device link to CMM%u\n", i);
- return -EINVAL;
- }
--
-- rcdu->cmms[i] = pdev;
- }
-
- return 0;
- }
-
-+static void rcar_du_modeset_cleanup(struct drm_device *dev, void *res)
-+{
-+ struct rcar_du_device *rcdu = to_rcar_du_device(dev);
-+ unsigned int i;
-+
-+ for (i = 0; i < ARRAY_SIZE(rcdu->cmms); ++i)
-+ platform_device_put(rcdu->cmms[i]);
-+}
-+
- int rcar_du_modeset_init(struct rcar_du_device *rcdu)
- {
- static const unsigned int mmio_offsets[] = {
-@@ -766,6 +778,10 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu)
- if (ret)
- return ret;
-
-+ ret = drmm_add_action(&rcdu->ddev, rcar_du_modeset_cleanup, NULL);
-+ if (ret)
-+ return ret;
-+
- dev->mode_config.min_width = 0;
- dev->mode_config.min_height = 0;
- dev->mode_config.normalize_zpos = true;
---
-2.27.0
-
+++ /dev/null
-From 4df5aea3f96d418f5a3bc06a5a1e32b3fddd4fb2 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 25 Jan 2021 18:36:43 +0530
-Subject: powerpc/sstep: Fix incorrect return from analyze_instr()
-
-From: Ananth N Mavinakayanahalli <ananth@linux.ibm.com>
-
-[ Upstream commit 718aae916fa6619c57c348beaedd675835cf1aa1 ]
-
-We currently just percolate the return value from analyze_instr()
-to the caller of emulate_step(), especially if it is a -1.
-
-For one particular case (opcode = 4) for instructions that aren't
-currently emulated, we are returning 'should not be single-stepped'
-while we should have returned 0 which says 'did not emulate, may
-have to single-step'.
-
-Fixes: 930d6288a26787 ("powerpc: sstep: Add support for maddhd, maddhdu, maddld instructions")
-Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.ibm.com>
-Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
-Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
-Reviewed-by: Sandipan Das <sandipan@linux.ibm.com>
-Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-Link: https://lore.kernel.org/r/161157999039.64773.14950289716779364766.stgit@thinktux.local
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- arch/powerpc/lib/sstep.c | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
-index b18bce1a209fa..edd4b275bd6a5 100644
---- a/arch/powerpc/lib/sstep.c
-+++ b/arch/powerpc/lib/sstep.c
-@@ -1380,6 +1380,11 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
-
- #ifdef __powerpc64__
- case 4:
-+ /*
-+ * There are very many instructions with this primary opcode
-+ * introduced in the ISA as early as v2.03. However, the ones
-+ * we currently emulate were all introduced with ISA 3.0
-+ */
- if (!cpu_has_feature(CPU_FTR_ARCH_300))
- return -1;
-
-@@ -1407,7 +1412,7 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
- * There are other instructions from ISA 3.0 with the same
- * primary opcode which do not have emulation support yet.
- */
-- return -1;
-+ goto unknown_opcode;
- #endif
-
- case 7: /* mulli */
---
-2.27.0
-
drm-rcar-du-fix-pm-reference-leak-in-rcar_cmm_enable.patch
drm-rcar-du-fix-crash-when-using-lvds1-clock-for-crt.patch
drm-rcar-du-fix-the-return-check-of-of_parse_phandle.patch
-drm-rcar-du-fix-leak-of-cmm-platform-device-referenc.patch
drm-amdgpu-fix-macro-name-_amdgpu_trace_h_-in-prepro.patch
mips-c-r4k-fix-section-mismatch-for-loongson2_sc_ini.patch
mips-lantiq-explicitly-compare-ltq_ebu_pcc_istat-aga.patch
ib-umad-return-epollerr-in-case-of-when-device-disas.patch
kvm-ppc-make-the-vmx-instruction-emulation-routines-.patch
powerpc-47x-disable-256k-page-size.patch
-powerpc-sstep-fix-incorrect-return-from-analyze_inst.patch
powerpc-time-enable-sched-clock-for-irqtime.patch
mmc-owl-mmc-fix-a-resource-leak-in-an-error-handling.patch
mmc-sdhci-sprd-fix-some-resource-leaks-in-the-remove.patch
+++ /dev/null
-From 325f040d5f8b69f1c68bdca1d73757f567424d4a Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Wed, 16 Dec 2020 03:19:46 +0200
-Subject: drm: rcar-du: Fix leak of CMM platform device reference
-
-From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
-
-[ Upstream commit 9fa120458da142da0d1d3eaf6f6a3a2c2c91d27b ]
-
-The device references acquired by of_find_device_by_node() are not
-released by the driver. Fix this by registering a cleanup action.
-
-Fixes: 8de707aeb452 ("drm: rcar-du: kms: Initialize CMM instances")
-Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
-Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- drivers/gpu/drm/rcar-du/rcar_du_kms.c | 22 +++++++++++++++++++---
- 1 file changed, 19 insertions(+), 3 deletions(-)
-
-diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
-index 7015e22872bbe..ecc894f0bc430 100644
---- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c
-+++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
-@@ -14,6 +14,7 @@
- #include <drm/drm_fb_cma_helper.h>
- #include <drm/drm_gem_cma_helper.h>
- #include <drm/drm_gem_framebuffer_helper.h>
-+#include <drm/drm_managed.h>
- #include <drm/drm_probe_helper.h>
- #include <drm/drm_vblank.h>
-
-@@ -726,8 +727,12 @@ static int rcar_du_cmm_init(struct rcar_du_device *rcdu)
- * disabled: return 0 and let the DU continue probing.
- */
- ret = rcar_cmm_init(pdev);
-- if (ret)
-+ if (ret) {
-+ platform_device_put(pdev);
- return ret == -ENODEV ? 0 : ret;
-+ }
-+
-+ rcdu->cmms[i] = pdev;
-
- /*
- * Enforce suspend/resume ordering by making the CMM a provider
-@@ -739,13 +744,20 @@ static int rcar_du_cmm_init(struct rcar_du_device *rcdu)
- "Failed to create device link to CMM%u\n", i);
- return -EINVAL;
- }
--
-- rcdu->cmms[i] = pdev;
- }
-
- return 0;
- }
-
-+static void rcar_du_modeset_cleanup(struct drm_device *dev, void *res)
-+{
-+ struct rcar_du_device *rcdu = to_rcar_du_device(dev);
-+ unsigned int i;
-+
-+ for (i = 0; i < ARRAY_SIZE(rcdu->cmms); ++i)
-+ platform_device_put(rcdu->cmms[i]);
-+}
-+
- int rcar_du_modeset_init(struct rcar_du_device *rcdu)
- {
- static const unsigned int mmio_offsets[] = {
-@@ -766,6 +778,10 @@ int rcar_du_modeset_init(struct rcar_du_device *rcdu)
- if (ret)
- return ret;
-
-+ ret = drmm_add_action(&rcdu->ddev, rcar_du_modeset_cleanup, NULL);
-+ if (ret)
-+ return ret;
-+
- dev->mode_config.min_width = 0;
- dev->mode_config.min_height = 0;
- dev->mode_config.normalize_zpos = true;
---
-2.27.0
-
drm-rcar-du-fix-pm-reference-leak-in-rcar_cmm_enable.patch
drm-rcar-du-fix-crash-when-using-lvds1-clock-for-crt.patch
drm-rcar-du-fix-the-return-check-of-of_parse_phandle.patch
-drm-rcar-du-fix-leak-of-cmm-platform-device-referenc.patch
drm-amdgpu-fix-macro-name-_amdgpu_trace_h_-in-prepro.patch
mips-c-r4k-fix-section-mismatch-for-loongson2_sc_ini.patch
mips-lantiq-explicitly-compare-ltq_ebu_pcc_istat-aga.patch
--- a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
+++ b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
-@@ -54,13 +54,13 @@ static int noinline_for_stack sun4i_ss_o
+@@ -46,13 +46,13 @@ static int noinline_for_stack sun4i_ss_o
spin_lock_irqsave(&ss->slock, flags);
}
}
writel(mode, ss->base + SS_CTL);
-@@ -240,13 +240,13 @@ static int sun4i_ss_cipher_poll(struct s
+@@ -221,13 +221,13 @@ static int sun4i_ss_cipher_poll(struct s
spin_lock_irqsave(&ss->slock, flags);
--- a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
+++ b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
-@@ -196,7 +196,7 @@ static int sun4i_ss_cipher_poll(struct s
+@@ -184,7 +184,7 @@ static int sun4i_ss_cipher_poll(struct s
unsigned int obo = 0; /* offset in bufo*/
unsigned int obl = 0; /* length of data in bufo */
unsigned long flags;
+++ /dev/null
-From b756f1c8fc9d84e3f546d7ffe056c5352f4aab05 Mon Sep 17 00:00:00 2001
-From: Corentin Labbe <clabbe@baylibre.com>
-Date: Mon, 14 Dec 2020 20:02:27 +0000
-Subject: crypto: sun4i-ss - IV register does not work on A10 and A13
-
-From: Corentin Labbe <clabbe@baylibre.com>
-
-commit b756f1c8fc9d84e3f546d7ffe056c5352f4aab05 upstream.
-
-Allwinner A10 and A13 SoC have a version of the SS which produce
-invalid IV in IVx register.
-
-Instead of adding a variant for those, let's convert SS to produce IV
-directly from data.
-Fixes: 6298e948215f2 ("crypto: sunxi-ss - Add Allwinner Security System crypto accelerator")
-Cc: <stable@vger.kernel.org>
-Signed-off-by: Corentin Labbe <clabbe@baylibre.com>
-Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- drivers/crypto/sunxi-ss/sun4i-ss-cipher.c | 34 ++++++++++++++++++++++++------
- 1 file changed, 28 insertions(+), 6 deletions(-)
-
---- a/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
-+++ b/drivers/crypto/sunxi-ss/sun4i-ss-cipher.c
-@@ -20,6 +20,7 @@ static int noinline_for_stack sun4i_ss_o
- unsigned int ivsize = crypto_skcipher_ivsize(tfm);
- struct sun4i_cipher_req_ctx *ctx = skcipher_request_ctx(areq);
- u32 mode = ctx->mode;
-+ void *backup_iv = NULL;
- /* when activating SS, the default FIFO space is SS_RX_DEFAULT(32) */
- u32 rx_cnt = SS_RX_DEFAULT;
- u32 tx_cnt = 0;
-@@ -44,6 +45,13 @@ static int noinline_for_stack sun4i_ss_o
- return -EINVAL;
- }
-
-+ if (areq->iv && ivsize > 0 && mode & SS_DECRYPTION) {
-+ backup_iv = kzalloc(ivsize, GFP_KERNEL);
-+ if (!backup_iv)
-+ return -ENOMEM;
-+ scatterwalk_map_and_copy(backup_iv, areq->src, areq->cryptlen - ivsize, ivsize, 0);
-+ }
-+
- spin_lock_irqsave(&ss->slock, flags);
-
- for (i = 0; i < op->keylen; i += 4)
-@@ -117,9 +125,12 @@ static int noinline_for_stack sun4i_ss_o
- } while (oleft);
-
- if (areq->iv) {
-- for (i = 0; i < 4 && i < ivsize / 4; i++) {
-- v = readl(ss->base + SS_IV0 + i * 4);
-- *(u32 *)(areq->iv + i * 4) = v;
-+ if (mode & SS_DECRYPTION) {
-+ memcpy(areq->iv, backup_iv, ivsize);
-+ kfree_sensitive(backup_iv);
-+ } else {
-+ scatterwalk_map_and_copy(areq->iv, areq->dst, areq->cryptlen - ivsize,
-+ ivsize, 0);
- }
- }
-
-@@ -176,6 +187,7 @@ static int sun4i_ss_cipher_poll(struct s
- unsigned int ileft = areq->cryptlen;
- unsigned int oleft = areq->cryptlen;
- unsigned int todo;
-+ void *backup_iv = NULL;
- struct sg_mapping_iter mi, mo;
- unsigned long pi = 0, po = 0; /* progress for in and out */
- bool miter_err;
-@@ -219,6 +231,13 @@ static int sun4i_ss_cipher_poll(struct s
- if (need_fallback)
- return sun4i_ss_cipher_poll_fallback(areq);
-
-+ if (areq->iv && ivsize > 0 && mode & SS_DECRYPTION) {
-+ backup_iv = kzalloc(ivsize, GFP_KERNEL);
-+ if (!backup_iv)
-+ return -ENOMEM;
-+ scatterwalk_map_and_copy(backup_iv, areq->src, areq->cryptlen - ivsize, ivsize, 0);
-+ }
-+
- spin_lock_irqsave(&ss->slock, flags);
-
- for (i = 0; i < op->keylen; i += 4)
-@@ -347,9 +366,12 @@ static int sun4i_ss_cipher_poll(struct s
- sg_miter_stop(&mo);
- }
- if (areq->iv) {
-- for (i = 0; i < 4 && i < ivsize / 4; i++) {
-- v = readl(ss->base + SS_IV0 + i * 4);
-- *(u32 *)(areq->iv + i * 4) = v;
-+ if (mode & SS_DECRYPTION) {
-+ memcpy(areq->iv, backup_iv, ivsize);
-+ kfree_sensitive(backup_iv);
-+ } else {
-+ scatterwalk_map_and_copy(areq->iv, areq->dst, areq->cryptlen - ivsize,
-+ ivsize, 0);
- }
- }
-
+++ /dev/null
-From 1dcc60e976b6f4c9ccf0f3939c43b3ec0057f8f2 Mon Sep 17 00:00:00 2001
-From: Sasha Levin <sashal@kernel.org>
-Date: Mon, 25 Jan 2021 18:36:43 +0530
-Subject: powerpc/sstep: Fix incorrect return from analyze_instr()
-
-From: Ananth N Mavinakayanahalli <ananth@linux.ibm.com>
-
-[ Upstream commit 718aae916fa6619c57c348beaedd675835cf1aa1 ]
-
-We currently just percolate the return value from analyze_instr()
-to the caller of emulate_step(), especially if it is a -1.
-
-For one particular case (opcode = 4) for instructions that aren't
-currently emulated, we are returning 'should not be single-stepped'
-while we should have returned 0 which says 'did not emulate, may
-have to single-step'.
-
-Fixes: 930d6288a26787 ("powerpc: sstep: Add support for maddhd, maddhdu, maddld instructions")
-Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.ibm.com>
-Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
-Tested-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
-Reviewed-by: Sandipan Das <sandipan@linux.ibm.com>
-Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
-Link: https://lore.kernel.org/r/161157999039.64773.14950289716779364766.stgit@thinktux.local
-Signed-off-by: Sasha Levin <sashal@kernel.org>
----
- arch/powerpc/lib/sstep.c | 7 ++++++-
- 1 file changed, 6 insertions(+), 1 deletion(-)
-
-diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c
-index c077acb983a19..bf3432b10d0af 100644
---- a/arch/powerpc/lib/sstep.c
-+++ b/arch/powerpc/lib/sstep.c
-@@ -1304,6 +1304,11 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
-
- #ifdef __powerpc64__
- case 4:
-+ /*
-+ * There are very many instructions with this primary opcode
-+ * introduced in the ISA as early as v2.03. However, the ones
-+ * we currently emulate were all introduced with ISA 3.0
-+ */
- if (!cpu_has_feature(CPU_FTR_ARCH_300))
- return -1;
-
-@@ -1331,7 +1336,7 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs,
- * There are other instructions from ISA 3.0 with the same
- * primary opcode which do not have emulation support yet.
- */
-- return -1;
-+ goto unknown_opcode;
- #endif
-
- case 7: /* mulli */
---
-2.27.0
-
ib-umad-return-epollerr-in-case-of-when-device-disas.patch
kvm-ppc-make-the-vmx-instruction-emulation-routines-.patch
powerpc-47x-disable-256k-page-size.patch
-powerpc-sstep-fix-incorrect-return-from-analyze_inst.patch
mmc-sdhci-sprd-fix-some-resource-leaks-in-the-remove.patch
mmc-usdhi6rol0-fix-a-resource-leak-in-the-error-hand.patch
mmc-renesas_sdhi_internal_dmac-fix-dma-buffer-alignm.patch
crypto-arm64-sha-add-missing-module-aliases.patch
crypto-aesni-prevent-misaligned-buffers-on-the-stack.patch
crypto-sun4i-ss-checking-sg-length-is-not-sufficient.patch
-crypto-sun4i-ss-iv-register-does-not-work-on-a10-and-a13.patch
crypto-sun4i-ss-handle-bigendian-for-cipher.patch
crypto-sun4i-ss-initialize-need_fallback.patch
seccomp-add-missing-return-in-non-void-function.patch