]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
drop crypto-nx scomp migration cluster based on RC review feedback
authorSasha Levin <sashal@kernel.org>
Wed, 17 Jun 2026 13:23:54 +0000 (09:23 -0400)
committerSasha Levin <sashal@kernel.org>
Wed, 17 Jun 2026 13:38:55 +0000 (09:38 -0400)
Dropped patches:

- "crypto: nx - Migrate to scomp API" (980b5705f4e7)
  Queues: 6.1, 5.15
  Reason: CRITICAL ppc64le build break (-Werror=incompatible-pointer-types
    in drivers/crypto/nx/nx-common-pseries.c:1021-1022). The backport
    assigns the new stateless alloc_ctx/free_ctx prototypes, but the scomp
    core prerequisite (stateless scomp_alg alloc_ctx/free_ctx) was not
    backported to 5.15/6.1, so scomp_alg still has the old stateful
    prototype. Queued only as a Stable-dep-of for adb3faf2db1a.
  Report: https://lore.kernel.org/stable/178163274542.15780.10458817119163247870@330cfa3079ca/
  Report: https://lore.kernel.org/stable/178163274374.15780.8786280632641904056@330cfa3079ca/

- "crypto: nx - fix bounce buffer leaks in nx842_crypto_{alloc,free}_ctx" (adb3faf2db1a)  [dependency]
  Queues: 6.1, 5.15
  Reason: the target fix; modifies the post-migration
    nx842_crypto_alloc_ctx()/nx842_crypto_free_ctx() and cannot build
    without the dropped scomp migration above.

- "crypto: nx - fix context leak in nx842_crypto_free_ctx" (344e6a4f7ff4)  [dependency]
  Queues: 6.1, 5.15
  Reason: Fixes: 980b5705f4e7; patches the post-migration
    nx842_crypto_free_ctx(void *) and depends on the dropped scomp migration.

- "crypto: nx - Avoid -Wflex-array-member-not-at-end warning" (1e6b251ce175)  [dependency]
  Queues: 6.1, 5.15
  Reason: Stable-dep-of adb3faf2db1a; queued only as a prerequisite for the
    dropped target fix, so dropped together with the cluster.

Signed-off-by: Sasha Levin <sashal@kernel.org>
queue-5.15/crypto-nx-avoid-wflex-array-member-not-at-end-warning.patch [deleted file]
queue-5.15/crypto-nx-fix-bounce-buffer-leaks-in-nx842_crypto_-alloc-free-_ctx.patch [deleted file]
queue-5.15/crypto-nx-fix-context-leak-in-nx842_crypto_free_ctx.patch [deleted file]
queue-5.15/crypto-nx-migrate-to-scomp-api.patch [deleted file]
queue-5.15/series
queue-6.1/crypto-nx-avoid-wflex-array-member-not-at-end-warning.patch [deleted file]
queue-6.1/crypto-nx-fix-bounce-buffer-leaks-in-nx842_crypto_-alloc-free-_ctx.patch [deleted file]
queue-6.1/crypto-nx-fix-context-leak-in-nx842_crypto_free_ctx.patch [deleted file]
queue-6.1/crypto-nx-migrate-to-scomp-api.patch [deleted file]
queue-6.1/series

diff --git a/queue-5.15/crypto-nx-avoid-wflex-array-member-not-at-end-warning.patch b/queue-5.15/crypto-nx-avoid-wflex-array-member-not-at-end-warning.patch
deleted file mode 100644 (file)
index 9f3084b..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-From stable+bounces-244907-greg=kroah.com@vger.kernel.org Sat May  9 09:23:40 2026
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri,  8 May 2026 23:53:31 -0400
-Subject: crypto: nx - Avoid -Wflex-array-member-not-at-end warning
-To: stable@vger.kernel.org
-Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>, Herbert Xu <herbert@gondor.apana.org.au>, Sasha Levin <sashal@kernel.org>
-Message-ID: <20260509035333.3119717-1-sashal@kernel.org>
-
-From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
-
-[ Upstream commit 1e6b251ce1759392666856908113dd5d7cea044d ]
-
--Wflex-array-member-not-at-end is coming in GCC-14, and we are getting
-ready to enable it globally. So, we are deprecating flexible-array
-members in the middle of another structure.
-
-There is currently an object (`header`) in `struct nx842_crypto_ctx`
-that contains a flexible structure (`struct nx842_crypto_header`):
-
-struct nx842_crypto_ctx {
-       ...
-        struct nx842_crypto_header header;
-        struct nx842_crypto_header_group group[NX842_CRYPTO_GROUP_MAX];
-       ...
-};
-
-So, in order to avoid ending up with a flexible-array member in the
-middle of another struct, we use the `struct_group_tagged()` helper to
-separate the flexible array from the rest of the members in the flexible
-structure:
-
-struct nx842_crypto_header {
-       struct_group_tagged(nx842_crypto_header_hdr, hdr,
-
-               ... the rest of the members
-
-       );
-        struct nx842_crypto_header_group group[];
-} __packed;
-
-With the change described above, we can now declare an object of the
-type of the tagged struct, without embedding the flexible array in the
-middle of another struct:
-
-struct nx842_crypto_ctx {
-       ...
-        struct nx842_crypto_header_hdr header;
-        struct nx842_crypto_header_group group[NX842_CRYPTO_GROUP_MAX];
-       ...
- } __packed;
-
-We also use `container_of()` whenever we need to retrieve a pointer to
-the flexible structure, through which we can access the flexible
-array if needed.
-
-So, with these changes, fix the following warning:
-
-In file included from drivers/crypto/nx/nx-842.c:55:
-drivers/crypto/nx/nx-842.h:174:36: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
-  174 |         struct nx842_crypto_header header;
-      |                                    ^~~~~~
-
-Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
-Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-Stable-dep-of: adb3faf2db1a ("crypto: nx - fix bounce buffer leaks in nx842_crypto_{alloc,free}_ctx")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- drivers/crypto/nx/nx-842.c |    6 ++++--
- drivers/crypto/nx/nx-842.h |   10 ++++++----
- 2 files changed, 10 insertions(+), 6 deletions(-)
-
---- a/drivers/crypto/nx/nx-842.c
-+++ b/drivers/crypto/nx/nx-842.c
-@@ -251,7 +251,9 @@ int nx842_crypto_compress(struct crypto_
-                         u8 *dst, unsigned int *dlen)
- {
-       struct nx842_crypto_ctx *ctx = crypto_tfm_ctx(tfm);
--      struct nx842_crypto_header *hdr = &ctx->header;
-+      struct nx842_crypto_header *hdr =
-+                              container_of(&ctx->header,
-+                                           struct nx842_crypto_header, hdr);
-       struct nx842_crypto_param p;
-       struct nx842_constraints c = *ctx->driver->constraints;
-       unsigned int groups, hdrsize, h;
-@@ -490,7 +492,7 @@ int nx842_crypto_decompress(struct crypt
-       }
-       memcpy(&ctx->header, src, hdr_len);
--      hdr = &ctx->header;
-+      hdr = container_of(&ctx->header, struct nx842_crypto_header, hdr);
-       for (n = 0; n < hdr->groups; n++) {
-               /* ignore applies to last group */
---- a/drivers/crypto/nx/nx-842.h
-+++ b/drivers/crypto/nx/nx-842.h
-@@ -157,9 +157,11 @@ struct nx842_crypto_header_group {
- } __packed;
- struct nx842_crypto_header {
--      __be16 magic;           /* NX842_CRYPTO_MAGIC */
--      __be16 ignore;          /* decompressed end bytes to ignore */
--      u8 groups;              /* total groups in this header */
-+      struct_group_tagged(nx842_crypto_header_hdr, hdr,
-+              __be16 magic;           /* NX842_CRYPTO_MAGIC */
-+              __be16 ignore;          /* decompressed end bytes to ignore */
-+              u8 groups;              /* total groups in this header */
-+      );
-       struct nx842_crypto_header_group group[];
- } __packed;
-@@ -171,7 +173,7 @@ struct nx842_crypto_ctx {
-       u8 *wmem;
-       u8 *sbounce, *dbounce;
--      struct nx842_crypto_header header;
-+      struct nx842_crypto_header_hdr header;
-       struct nx842_crypto_header_group group[NX842_CRYPTO_GROUP_MAX];
-       struct nx842_driver *driver;
diff --git a/queue-5.15/crypto-nx-fix-bounce-buffer-leaks-in-nx842_crypto_-alloc-free-_ctx.patch b/queue-5.15/crypto-nx-fix-bounce-buffer-leaks-in-nx842_crypto_-alloc-free-_ctx.patch
deleted file mode 100644 (file)
index 8b358c2..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-From stable+bounces-244909-greg=kroah.com@vger.kernel.org Sat May  9 09:23:52 2026
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri,  8 May 2026 23:53:33 -0400
-Subject: crypto: nx - fix bounce buffer leaks in nx842_crypto_{alloc,free}_ctx
-To: stable@vger.kernel.org
-Cc: Thorsten Blum <thorsten.blum@linux.dev>, Herbert Xu <herbert@gondor.apana.org.au>, Sasha Levin <sashal@kernel.org>
-Message-ID: <20260509035333.3119717-3-sashal@kernel.org>
-
-From: Thorsten Blum <thorsten.blum@linux.dev>
-
-[ Upstream commit adb3faf2db1a66d0f015b44ac909a32dfc7f2f9c ]
-
-The bounce buffers are allocated with __get_free_pages() using
-BOUNCE_BUFFER_ORDER (order 2 = 4 pages), but both the allocation error
-path and nx842_crypto_free_ctx() release the buffers with free_page().
-Use free_pages() with the matching order instead.
-
-Fixes: ed70b479c2c0 ("crypto: nx - add hardware 842 crypto comp alg")
-Cc: stable@vger.kernel.org
-Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
-Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- drivers/crypto/nx/nx-842.c |    8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
---- a/drivers/crypto/nx/nx-842.c
-+++ b/drivers/crypto/nx/nx-842.c
-@@ -116,8 +116,8 @@ void *nx842_crypto_alloc_ctx(struct nx84
-       ctx->dbounce = (u8 *)__get_free_pages(GFP_KERNEL, BOUNCE_BUFFER_ORDER);
-       if (!ctx->wmem || !ctx->sbounce || !ctx->dbounce) {
-               kfree(ctx->wmem);
--              free_page((unsigned long)ctx->sbounce);
--              free_page((unsigned long)ctx->dbounce);
-+              free_pages((unsigned long)ctx->sbounce, BOUNCE_BUFFER_ORDER);
-+              free_pages((unsigned long)ctx->dbounce, BOUNCE_BUFFER_ORDER);
-               kfree(ctx);
-               return ERR_PTR(-ENOMEM);
-       }
-@@ -131,8 +131,8 @@ void nx842_crypto_free_ctx(void *p)
-       struct nx842_crypto_ctx *ctx = p;
-       kfree(ctx->wmem);
--      free_page((unsigned long)ctx->sbounce);
--      free_page((unsigned long)ctx->dbounce);
-+      free_pages((unsigned long)ctx->sbounce, BOUNCE_BUFFER_ORDER);
-+      free_pages((unsigned long)ctx->dbounce, BOUNCE_BUFFER_ORDER);
- }
- EXPORT_SYMBOL_GPL(nx842_crypto_free_ctx);
diff --git a/queue-5.15/crypto-nx-fix-context-leak-in-nx842_crypto_free_ctx.patch b/queue-5.15/crypto-nx-fix-context-leak-in-nx842_crypto_free_ctx.patch
deleted file mode 100644 (file)
index 8068a81..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-From 344e6a4f7ff4756b9b3f75e0eb7eaec297e35540 Mon Sep 17 00:00:00 2001
-From: Thorsten Blum <thorsten.blum@linux.dev>
-Date: Wed, 11 Mar 2026 16:56:49 +0100
-Subject: crypto: nx - fix context leak in nx842_crypto_free_ctx
-
-From: Thorsten Blum <thorsten.blum@linux.dev>
-
-commit 344e6a4f7ff4756b9b3f75e0eb7eaec297e35540 upstream.
-
-Since the scomp conversion, nx842_crypto_alloc_ctx() allocates the
-context separately, but nx842_crypto_free_ctx() never releases it. Add
-the missing kfree(ctx) to nx842_crypto_free_ctx(), and reuse
-nx842_crypto_free_ctx() in the allocation error path.
-
-Fixes: 980b5705f4e7 ("crypto: nx - Migrate to scomp API")
-Cc: stable@vger.kernel.org
-Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
-Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
-Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- drivers/crypto/nx/nx-842.c |    6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
-
---- a/drivers/crypto/nx/nx-842.c
-+++ b/drivers/crypto/nx/nx-842.c
-@@ -115,10 +115,7 @@ void *nx842_crypto_alloc_ctx(struct nx84
-       ctx->sbounce = (u8 *)__get_free_pages(GFP_KERNEL, BOUNCE_BUFFER_ORDER);
-       ctx->dbounce = (u8 *)__get_free_pages(GFP_KERNEL, BOUNCE_BUFFER_ORDER);
-       if (!ctx->wmem || !ctx->sbounce || !ctx->dbounce) {
--              kfree(ctx->wmem);
--              free_pages((unsigned long)ctx->sbounce, BOUNCE_BUFFER_ORDER);
--              free_pages((unsigned long)ctx->dbounce, BOUNCE_BUFFER_ORDER);
--              kfree(ctx);
-+              nx842_crypto_free_ctx(ctx);
-               return ERR_PTR(-ENOMEM);
-       }
-@@ -133,6 +130,7 @@ void nx842_crypto_free_ctx(void *p)
-       kfree(ctx->wmem);
-       free_pages((unsigned long)ctx->sbounce, BOUNCE_BUFFER_ORDER);
-       free_pages((unsigned long)ctx->dbounce, BOUNCE_BUFFER_ORDER);
-+      kfree(ctx);
- }
- EXPORT_SYMBOL_GPL(nx842_crypto_free_ctx);
diff --git a/queue-5.15/crypto-nx-migrate-to-scomp-api.patch b/queue-5.15/crypto-nx-migrate-to-scomp-api.patch
deleted file mode 100644 (file)
index 325dda0..0000000
+++ /dev/null
@@ -1,279 +0,0 @@
-From stable+bounces-244908-greg=kroah.com@vger.kernel.org Sat May  9 09:23:45 2026
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri,  8 May 2026 23:53:32 -0400
-Subject: crypto: nx - Migrate to scomp API
-To: stable@vger.kernel.org
-Cc: Ard Biesheuvel <ardb@kernel.org>, Herbert Xu <herbert@gondor.apana.org.au>, Sasha Levin <sashal@kernel.org>
-Message-ID: <20260509035333.3119717-2-sashal@kernel.org>
-
-From: Ard Biesheuvel <ardb@kernel.org>
-
-[ Upstream commit 980b5705f4e73f567e405cd18337cc32fd51cf79 ]
-
-The only remaining user of 842 compression has been migrated to the
-acomp compression API, and so the NX hardware driver has to follow suit,
-given that no users of the obsolete 'comp' API remain, and it is going
-to be removed.
-
-So migrate the NX driver code to scomp. These will be wrapped and
-exposed as acomp implementation via the crypto subsystem's
-acomp-to-scomp adaptation layer.
-
-Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
-Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-Stable-dep-of: adb3faf2db1a ("crypto: nx - fix bounce buffer leaks in nx842_crypto_{alloc,free}_ctx")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- drivers/crypto/nx/nx-842.c            |   33 +++++++++++++++++++--------------
- drivers/crypto/nx/nx-842.h            |   14 ++++++++------
- drivers/crypto/nx/nx-common-powernv.c |   31 +++++++++++++++----------------
- drivers/crypto/nx/nx-common-pseries.c |   33 ++++++++++++++++-----------------
- 4 files changed, 58 insertions(+), 53 deletions(-)
-
---- a/drivers/crypto/nx/nx-842.c
-+++ b/drivers/crypto/nx/nx-842.c
-@@ -101,9 +101,13 @@ static int update_param(struct nx842_cry
-       return 0;
- }
--int nx842_crypto_init(struct crypto_tfm *tfm, struct nx842_driver *driver)
-+void *nx842_crypto_alloc_ctx(struct nx842_driver *driver)
- {
--      struct nx842_crypto_ctx *ctx = crypto_tfm_ctx(tfm);
-+      struct nx842_crypto_ctx *ctx;
-+
-+      ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
-+      if (!ctx)
-+              return ERR_PTR(-ENOMEM);
-       spin_lock_init(&ctx->lock);
-       ctx->driver = driver;
-@@ -114,22 +118,23 @@ int nx842_crypto_init(struct crypto_tfm
-               kfree(ctx->wmem);
-               free_page((unsigned long)ctx->sbounce);
-               free_page((unsigned long)ctx->dbounce);
--              return -ENOMEM;
-+              kfree(ctx);
-+              return ERR_PTR(-ENOMEM);
-       }
--      return 0;
-+      return ctx;
- }
--EXPORT_SYMBOL_GPL(nx842_crypto_init);
-+EXPORT_SYMBOL_GPL(nx842_crypto_alloc_ctx);
--void nx842_crypto_exit(struct crypto_tfm *tfm)
-+void nx842_crypto_free_ctx(void *p)
- {
--      struct nx842_crypto_ctx *ctx = crypto_tfm_ctx(tfm);
-+      struct nx842_crypto_ctx *ctx = p;
-       kfree(ctx->wmem);
-       free_page((unsigned long)ctx->sbounce);
-       free_page((unsigned long)ctx->dbounce);
- }
--EXPORT_SYMBOL_GPL(nx842_crypto_exit);
-+EXPORT_SYMBOL_GPL(nx842_crypto_free_ctx);
- static void check_constraints(struct nx842_constraints *c)
- {
-@@ -246,11 +251,11 @@ nospc:
-       return update_param(p, slen, dskip + dlen);
- }
--int nx842_crypto_compress(struct crypto_tfm *tfm,
-+int nx842_crypto_compress(struct crypto_scomp *tfm,
-                         const u8 *src, unsigned int slen,
--                        u8 *dst, unsigned int *dlen)
-+                        u8 *dst, unsigned int *dlen, void *pctx)
- {
--      struct nx842_crypto_ctx *ctx = crypto_tfm_ctx(tfm);
-+      struct nx842_crypto_ctx *ctx = pctx;
-       struct nx842_crypto_header *hdr =
-                               container_of(&ctx->header,
-                                            struct nx842_crypto_header, hdr);
-@@ -431,11 +436,11 @@ usesw:
-       return update_param(p, slen + padding, dlen);
- }
--int nx842_crypto_decompress(struct crypto_tfm *tfm,
-+int nx842_crypto_decompress(struct crypto_scomp *tfm,
-                           const u8 *src, unsigned int slen,
--                          u8 *dst, unsigned int *dlen)
-+                          u8 *dst, unsigned int *dlen, void *pctx)
- {
--      struct nx842_crypto_ctx *ctx = crypto_tfm_ctx(tfm);
-+      struct nx842_crypto_ctx *ctx = pctx;
-       struct nx842_crypto_header *hdr;
-       struct nx842_crypto_param p;
-       struct nx842_constraints c = *ctx->driver->constraints;
---- a/drivers/crypto/nx/nx-842.h
-+++ b/drivers/crypto/nx/nx-842.h
-@@ -101,6 +101,8 @@
- #define LEN_ON_SIZE(pa, size) ((size) - ((pa) & ((size) - 1)))
- #define LEN_ON_PAGE(pa)               LEN_ON_SIZE(pa, PAGE_SIZE)
-+struct crypto_scomp;
-+
- static inline unsigned long nx842_get_pa(void *addr)
- {
-       if (!is_vmalloc_addr(addr))
-@@ -179,13 +181,13 @@ struct nx842_crypto_ctx {
-       struct nx842_driver *driver;
- };
--int nx842_crypto_init(struct crypto_tfm *tfm, struct nx842_driver *driver);
--void nx842_crypto_exit(struct crypto_tfm *tfm);
--int nx842_crypto_compress(struct crypto_tfm *tfm,
-+void *nx842_crypto_alloc_ctx(struct nx842_driver *driver);
-+void nx842_crypto_free_ctx(void *ctx);
-+int nx842_crypto_compress(struct crypto_scomp *tfm,
-                         const u8 *src, unsigned int slen,
--                        u8 *dst, unsigned int *dlen);
--int nx842_crypto_decompress(struct crypto_tfm *tfm,
-+                        u8 *dst, unsigned int *dlen, void *ctx);
-+int nx842_crypto_decompress(struct crypto_scomp *tfm,
-                           const u8 *src, unsigned int slen,
--                          u8 *dst, unsigned int *dlen);
-+                          u8 *dst, unsigned int *dlen, void *ctx);
- #endif /* __NX_842_H__ */
---- a/drivers/crypto/nx/nx-common-powernv.c
-+++ b/drivers/crypto/nx/nx-common-powernv.c
-@@ -9,6 +9,7 @@
- #include "nx-842.h"
-+#include <crypto/internal/scompress.h>
- #include <linux/timer.h>
- #include <asm/prom.h>
-@@ -1034,23 +1035,21 @@ static struct nx842_driver nx842_powernv
-       .decompress =   nx842_powernv_decompress,
- };
--static int nx842_powernv_crypto_init(struct crypto_tfm *tfm)
-+static void *nx842_powernv_crypto_alloc_ctx(void)
- {
--      return nx842_crypto_init(tfm, &nx842_powernv_driver);
-+      return nx842_crypto_alloc_ctx(&nx842_powernv_driver);
- }
--static struct crypto_alg nx842_powernv_alg = {
--      .cra_name               = "842",
--      .cra_driver_name        = "842-nx",
--      .cra_priority           = 300,
--      .cra_flags              = CRYPTO_ALG_TYPE_COMPRESS,
--      .cra_ctxsize            = sizeof(struct nx842_crypto_ctx),
--      .cra_module             = THIS_MODULE,
--      .cra_init               = nx842_powernv_crypto_init,
--      .cra_exit               = nx842_crypto_exit,
--      .cra_u                  = { .compress = {
--      .coa_compress           = nx842_crypto_compress,
--      .coa_decompress         = nx842_crypto_decompress } }
-+static struct scomp_alg nx842_powernv_alg = {
-+      .base.cra_name          = "842",
-+      .base.cra_driver_name   = "842-nx",
-+      .base.cra_priority      = 300,
-+      .base.cra_module        = THIS_MODULE,
-+
-+      .alloc_ctx              = nx842_powernv_crypto_alloc_ctx,
-+      .free_ctx               = nx842_crypto_free_ctx,
-+      .compress               = nx842_crypto_compress,
-+      .decompress             = nx842_crypto_decompress,
- };
- static __init int nx_compress_powernv_init(void)
-@@ -1110,7 +1109,7 @@ static __init int nx_compress_powernv_in
-               nx842_powernv_exec = nx842_exec_vas;
-       }
--      ret = crypto_register_alg(&nx842_powernv_alg);
-+      ret = crypto_register_scomp(&nx842_powernv_alg);
-       if (ret) {
-               nx_delete_coprocs();
-               return ret;
-@@ -1131,7 +1130,7 @@ static void __exit nx_compress_powernv_e
-       if (!nx842_ct)
-               vas_unregister_api_powernv();
--      crypto_unregister_alg(&nx842_powernv_alg);
-+      crypto_unregister_scomp(&nx842_powernv_alg);
-       nx_delete_coprocs();
- }
---- a/drivers/crypto/nx/nx-common-pseries.c
-+++ b/drivers/crypto/nx/nx-common-pseries.c
-@@ -11,6 +11,7 @@
- #include <asm/vio.h>
- #include <asm/hvcall.h>
- #include <asm/vas.h>
-+#include <crypto/internal/scompress.h>
- #include "nx-842.h"
- #include "nx_csbcpb.h" /* struct nx_csbcpb */
-@@ -1006,23 +1007,21 @@ static struct nx842_driver nx842_pseries
-       .decompress =   nx842_pseries_decompress,
- };
--static int nx842_pseries_crypto_init(struct crypto_tfm *tfm)
-+static void *nx842_pseries_crypto_alloc_ctx(void)
- {
--      return nx842_crypto_init(tfm, &nx842_pseries_driver);
-+      return nx842_crypto_alloc_ctx(&nx842_pseries_driver);
- }
--static struct crypto_alg nx842_pseries_alg = {
--      .cra_name               = "842",
--      .cra_driver_name        = "842-nx",
--      .cra_priority           = 300,
--      .cra_flags              = CRYPTO_ALG_TYPE_COMPRESS,
--      .cra_ctxsize            = sizeof(struct nx842_crypto_ctx),
--      .cra_module             = THIS_MODULE,
--      .cra_init               = nx842_pseries_crypto_init,
--      .cra_exit               = nx842_crypto_exit,
--      .cra_u                  = { .compress = {
--      .coa_compress           = nx842_crypto_compress,
--      .coa_decompress         = nx842_crypto_decompress } }
-+static struct scomp_alg nx842_pseries_alg = {
-+      .base.cra_name          = "842",
-+      .base.cra_driver_name   = "842-nx",
-+      .base.cra_priority      = 300,
-+      .base.cra_module        = THIS_MODULE,
-+
-+      .alloc_ctx              = nx842_pseries_crypto_alloc_ctx,
-+      .free_ctx               = nx842_crypto_free_ctx,
-+      .compress               = nx842_crypto_compress,
-+      .decompress             = nx842_crypto_decompress,
- };
- static int nx842_probe(struct vio_dev *viodev,
-@@ -1070,7 +1069,7 @@ static int nx842_probe(struct vio_dev *v
-       if (ret)
-               goto error;
--      ret = crypto_register_alg(&nx842_pseries_alg);
-+      ret = crypto_register_scomp(&nx842_pseries_alg);
-       if (ret) {
-               dev_err(&viodev->dev, "could not register comp alg: %d\n", ret);
-               goto error;
-@@ -1118,7 +1117,7 @@ static void nx842_remove(struct vio_dev
-       if (caps_feat)
-               sysfs_remove_group(&viodev->dev.kobj, &nxcop_caps_attr_group);
--      crypto_unregister_alg(&nx842_pseries_alg);
-+      crypto_unregister_scomp(&nx842_pseries_alg);
-       spin_lock_irqsave(&devdata_mutex, flags);
-       old_devdata = rcu_dereference_check(devdata,
-@@ -1247,7 +1246,7 @@ static void __exit nx842_pseries_exit(vo
-       vas_unregister_api_pseries();
--      crypto_unregister_alg(&nx842_pseries_alg);
-+      crypto_unregister_scomp(&nx842_pseries_alg);
-       spin_lock_irqsave(&devdata_mutex, flags);
-       old_devdata = rcu_dereference_check(devdata,
index dc07ae5bc88f9c55fe50ab9f554ed016821b9102..b8246f9bf2caa71164c644014a161833b55a671c 100644 (file)
@@ -284,9 +284,6 @@ hfsplus-fix-held-lock-freed-on-hfsplus_fill_super.patch
 bluetooth-hci_event-fix-potential-uaf-in-ssp-passkey-handlers.patch
 can-ucan-fix-typos-in-comments.patch
 can-ucan-fix-devres-lifetime.patch
-crypto-nx-avoid-wflex-array-member-not-at-end-warning.patch
-crypto-nx-migrate-to-scomp-api.patch
-crypto-nx-fix-bounce-buffer-leaks-in-nx842_crypto_-alloc-free-_ctx.patch
 erofs-fix-unsigned-underflow-in-z_erofs_lz4_handle_overlap.patch
 ceph-only-d_add-negative-dentries-when-they-are-unhashed.patch
 alsa-aloop-fix-peer-runtime-uaf-during-format-change-stop.patch
@@ -402,7 +399,6 @@ mptcp-close-toctou-race-while-computing-rcv_wnd.patch
 fbdev-vt8500lcdfb-fix-dma_free_coherent-cpu_addr-parameter.patch
 apparmor-validate-default-dfa-states-are-in-bounds.patch
 x86-cpu-amd-move-the-zen3-btc_no-detection-to-the-zen3-init-function.patch
-crypto-nx-fix-context-leak-in-nx842_crypto_free_ctx.patch
 media-rc-ttusbir-fix-inverted-error-logic.patch
 batman-adv-tp_meter-fix-tp_vars-reference-leak-in-receiver-shutdown.patch
 media-rc-igorplugusb-fix-control-request-setup-packet.patch
diff --git a/queue-6.1/crypto-nx-avoid-wflex-array-member-not-at-end-warning.patch b/queue-6.1/crypto-nx-avoid-wflex-array-member-not-at-end-warning.patch
deleted file mode 100644 (file)
index daaa07b..0000000
+++ /dev/null
@@ -1,120 +0,0 @@
-From stable+bounces-244904-greg=kroah.com@vger.kernel.org Sat May  9 09:14:27 2026
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri,  8 May 2026 23:44:17 -0400
-Subject: crypto: nx - Avoid -Wflex-array-member-not-at-end warning
-To: stable@vger.kernel.org
-Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>, Herbert Xu <herbert@gondor.apana.org.au>, Sasha Levin <sashal@kernel.org>
-Message-ID: <20260509034419.3105450-1-sashal@kernel.org>
-
-From: "Gustavo A. R. Silva" <gustavoars@kernel.org>
-
-[ Upstream commit 1e6b251ce1759392666856908113dd5d7cea044d ]
-
--Wflex-array-member-not-at-end is coming in GCC-14, and we are getting
-ready to enable it globally. So, we are deprecating flexible-array
-members in the middle of another structure.
-
-There is currently an object (`header`) in `struct nx842_crypto_ctx`
-that contains a flexible structure (`struct nx842_crypto_header`):
-
-struct nx842_crypto_ctx {
-       ...
-        struct nx842_crypto_header header;
-        struct nx842_crypto_header_group group[NX842_CRYPTO_GROUP_MAX];
-       ...
-};
-
-So, in order to avoid ending up with a flexible-array member in the
-middle of another struct, we use the `struct_group_tagged()` helper to
-separate the flexible array from the rest of the members in the flexible
-structure:
-
-struct nx842_crypto_header {
-       struct_group_tagged(nx842_crypto_header_hdr, hdr,
-
-               ... the rest of the members
-
-       );
-        struct nx842_crypto_header_group group[];
-} __packed;
-
-With the change described above, we can now declare an object of the
-type of the tagged struct, without embedding the flexible array in the
-middle of another struct:
-
-struct nx842_crypto_ctx {
-       ...
-        struct nx842_crypto_header_hdr header;
-        struct nx842_crypto_header_group group[NX842_CRYPTO_GROUP_MAX];
-       ...
- } __packed;
-
-We also use `container_of()` whenever we need to retrieve a pointer to
-the flexible structure, through which we can access the flexible
-array if needed.
-
-So, with these changes, fix the following warning:
-
-In file included from drivers/crypto/nx/nx-842.c:55:
-drivers/crypto/nx/nx-842.h:174:36: warning: structure containing a flexible array member is not at the end of another structure [-Wflex-array-member-not-at-end]
-  174 |         struct nx842_crypto_header header;
-      |                                    ^~~~~~
-
-Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
-Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-Stable-dep-of: adb3faf2db1a ("crypto: nx - fix bounce buffer leaks in nx842_crypto_{alloc,free}_ctx")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- drivers/crypto/nx/nx-842.c |    6 ++++--
- drivers/crypto/nx/nx-842.h |   10 ++++++----
- 2 files changed, 10 insertions(+), 6 deletions(-)
-
---- a/drivers/crypto/nx/nx-842.c
-+++ b/drivers/crypto/nx/nx-842.c
-@@ -251,7 +251,9 @@ int nx842_crypto_compress(struct crypto_
-                         u8 *dst, unsigned int *dlen)
- {
-       struct nx842_crypto_ctx *ctx = crypto_tfm_ctx(tfm);
--      struct nx842_crypto_header *hdr = &ctx->header;
-+      struct nx842_crypto_header *hdr =
-+                              container_of(&ctx->header,
-+                                           struct nx842_crypto_header, hdr);
-       struct nx842_crypto_param p;
-       struct nx842_constraints c = *ctx->driver->constraints;
-       unsigned int groups, hdrsize, h;
-@@ -490,7 +492,7 @@ int nx842_crypto_decompress(struct crypt
-       }
-       memcpy(&ctx->header, src, hdr_len);
--      hdr = &ctx->header;
-+      hdr = container_of(&ctx->header, struct nx842_crypto_header, hdr);
-       for (n = 0; n < hdr->groups; n++) {
-               /* ignore applies to last group */
---- a/drivers/crypto/nx/nx-842.h
-+++ b/drivers/crypto/nx/nx-842.h
-@@ -157,9 +157,11 @@ struct nx842_crypto_header_group {
- } __packed;
- struct nx842_crypto_header {
--      __be16 magic;           /* NX842_CRYPTO_MAGIC */
--      __be16 ignore;          /* decompressed end bytes to ignore */
--      u8 groups;              /* total groups in this header */
-+      struct_group_tagged(nx842_crypto_header_hdr, hdr,
-+              __be16 magic;           /* NX842_CRYPTO_MAGIC */
-+              __be16 ignore;          /* decompressed end bytes to ignore */
-+              u8 groups;              /* total groups in this header */
-+      );
-       struct nx842_crypto_header_group group[];
- } __packed;
-@@ -171,7 +173,7 @@ struct nx842_crypto_ctx {
-       u8 *wmem;
-       u8 *sbounce, *dbounce;
--      struct nx842_crypto_header header;
-+      struct nx842_crypto_header_hdr header;
-       struct nx842_crypto_header_group group[NX842_CRYPTO_GROUP_MAX];
-       struct nx842_driver *driver;
diff --git a/queue-6.1/crypto-nx-fix-bounce-buffer-leaks-in-nx842_crypto_-alloc-free-_ctx.patch b/queue-6.1/crypto-nx-fix-bounce-buffer-leaks-in-nx842_crypto_-alloc-free-_ctx.patch
deleted file mode 100644 (file)
index 244ef83..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-From stable+bounces-244906-greg=kroah.com@vger.kernel.org Sat May  9 09:14:35 2026
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri,  8 May 2026 23:44:19 -0400
-Subject: crypto: nx - fix bounce buffer leaks in nx842_crypto_{alloc,free}_ctx
-To: stable@vger.kernel.org
-Cc: Thorsten Blum <thorsten.blum@linux.dev>, Herbert Xu <herbert@gondor.apana.org.au>, Sasha Levin <sashal@kernel.org>
-Message-ID: <20260509034419.3105450-3-sashal@kernel.org>
-
-From: Thorsten Blum <thorsten.blum@linux.dev>
-
-[ Upstream commit adb3faf2db1a66d0f015b44ac909a32dfc7f2f9c ]
-
-The bounce buffers are allocated with __get_free_pages() using
-BOUNCE_BUFFER_ORDER (order 2 = 4 pages), but both the allocation error
-path and nx842_crypto_free_ctx() release the buffers with free_page().
-Use free_pages() with the matching order instead.
-
-Fixes: ed70b479c2c0 ("crypto: nx - add hardware 842 crypto comp alg")
-Cc: stable@vger.kernel.org
-Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
-Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-Signed-off-by: Sasha Levin <sashal@kernel.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- drivers/crypto/nx/nx-842.c |    8 ++++----
- 1 file changed, 4 insertions(+), 4 deletions(-)
-
---- a/drivers/crypto/nx/nx-842.c
-+++ b/drivers/crypto/nx/nx-842.c
-@@ -116,8 +116,8 @@ void *nx842_crypto_alloc_ctx(struct nx84
-       ctx->dbounce = (u8 *)__get_free_pages(GFP_KERNEL, BOUNCE_BUFFER_ORDER);
-       if (!ctx->wmem || !ctx->sbounce || !ctx->dbounce) {
-               kfree(ctx->wmem);
--              free_page((unsigned long)ctx->sbounce);
--              free_page((unsigned long)ctx->dbounce);
-+              free_pages((unsigned long)ctx->sbounce, BOUNCE_BUFFER_ORDER);
-+              free_pages((unsigned long)ctx->dbounce, BOUNCE_BUFFER_ORDER);
-               kfree(ctx);
-               return ERR_PTR(-ENOMEM);
-       }
-@@ -131,8 +131,8 @@ void nx842_crypto_free_ctx(void *p)
-       struct nx842_crypto_ctx *ctx = p;
-       kfree(ctx->wmem);
--      free_page((unsigned long)ctx->sbounce);
--      free_page((unsigned long)ctx->dbounce);
-+      free_pages((unsigned long)ctx->sbounce, BOUNCE_BUFFER_ORDER);
-+      free_pages((unsigned long)ctx->dbounce, BOUNCE_BUFFER_ORDER);
- }
- EXPORT_SYMBOL_GPL(nx842_crypto_free_ctx);
diff --git a/queue-6.1/crypto-nx-fix-context-leak-in-nx842_crypto_free_ctx.patch b/queue-6.1/crypto-nx-fix-context-leak-in-nx842_crypto_free_ctx.patch
deleted file mode 100644 (file)
index 8068a81..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-From 344e6a4f7ff4756b9b3f75e0eb7eaec297e35540 Mon Sep 17 00:00:00 2001
-From: Thorsten Blum <thorsten.blum@linux.dev>
-Date: Wed, 11 Mar 2026 16:56:49 +0100
-Subject: crypto: nx - fix context leak in nx842_crypto_free_ctx
-
-From: Thorsten Blum <thorsten.blum@linux.dev>
-
-commit 344e6a4f7ff4756b9b3f75e0eb7eaec297e35540 upstream.
-
-Since the scomp conversion, nx842_crypto_alloc_ctx() allocates the
-context separately, but nx842_crypto_free_ctx() never releases it. Add
-the missing kfree(ctx) to nx842_crypto_free_ctx(), and reuse
-nx842_crypto_free_ctx() in the allocation error path.
-
-Fixes: 980b5705f4e7 ("crypto: nx - Migrate to scomp API")
-Cc: stable@vger.kernel.org
-Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
-Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
-Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- drivers/crypto/nx/nx-842.c |    6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
-
---- a/drivers/crypto/nx/nx-842.c
-+++ b/drivers/crypto/nx/nx-842.c
-@@ -115,10 +115,7 @@ void *nx842_crypto_alloc_ctx(struct nx84
-       ctx->sbounce = (u8 *)__get_free_pages(GFP_KERNEL, BOUNCE_BUFFER_ORDER);
-       ctx->dbounce = (u8 *)__get_free_pages(GFP_KERNEL, BOUNCE_BUFFER_ORDER);
-       if (!ctx->wmem || !ctx->sbounce || !ctx->dbounce) {
--              kfree(ctx->wmem);
--              free_pages((unsigned long)ctx->sbounce, BOUNCE_BUFFER_ORDER);
--              free_pages((unsigned long)ctx->dbounce, BOUNCE_BUFFER_ORDER);
--              kfree(ctx);
-+              nx842_crypto_free_ctx(ctx);
-               return ERR_PTR(-ENOMEM);
-       }
-@@ -133,6 +130,7 @@ void nx842_crypto_free_ctx(void *p)
-       kfree(ctx->wmem);
-       free_pages((unsigned long)ctx->sbounce, BOUNCE_BUFFER_ORDER);
-       free_pages((unsigned long)ctx->dbounce, BOUNCE_BUFFER_ORDER);
-+      kfree(ctx);
- }
- EXPORT_SYMBOL_GPL(nx842_crypto_free_ctx);
diff --git a/queue-6.1/crypto-nx-migrate-to-scomp-api.patch b/queue-6.1/crypto-nx-migrate-to-scomp-api.patch
deleted file mode 100644 (file)
index 959beba..0000000
+++ /dev/null
@@ -1,279 +0,0 @@
-From stable+bounces-244905-greg=kroah.com@vger.kernel.org Sat May  9 09:14:30 2026
-From: Sasha Levin <sashal@kernel.org>
-Date: Fri,  8 May 2026 23:44:18 -0400
-Subject: crypto: nx - Migrate to scomp API
-To: stable@vger.kernel.org
-Cc: Ard Biesheuvel <ardb@kernel.org>, Herbert Xu <herbert@gondor.apana.org.au>, Sasha Levin <sashal@kernel.org>
-Message-ID: <20260509034419.3105450-2-sashal@kernel.org>
-
-From: Ard Biesheuvel <ardb@kernel.org>
-
-[ Upstream commit 980b5705f4e73f567e405cd18337cc32fd51cf79 ]
-
-The only remaining user of 842 compression has been migrated to the
-acomp compression API, and so the NX hardware driver has to follow suit,
-given that no users of the obsolete 'comp' API remain, and it is going
-to be removed.
-
-So migrate the NX driver code to scomp. These will be wrapped and
-exposed as acomp implementation via the crypto subsystem's
-acomp-to-scomp adaptation layer.
-
-Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
-Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-Stable-dep-of: adb3faf2db1a ("crypto: nx - fix bounce buffer leaks in nx842_crypto_{alloc,free}_ctx")
-Signed-off-by: Sasha Levin <sashal@kernel.org>
-Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
----
- drivers/crypto/nx/nx-842.c            |   33 +++++++++++++++++++--------------
- drivers/crypto/nx/nx-842.h            |   14 ++++++++------
- drivers/crypto/nx/nx-common-powernv.c |   31 +++++++++++++++----------------
- drivers/crypto/nx/nx-common-pseries.c |   33 ++++++++++++++++-----------------
- 4 files changed, 58 insertions(+), 53 deletions(-)
-
---- a/drivers/crypto/nx/nx-842.c
-+++ b/drivers/crypto/nx/nx-842.c
-@@ -101,9 +101,13 @@ static int update_param(struct nx842_cry
-       return 0;
- }
--int nx842_crypto_init(struct crypto_tfm *tfm, struct nx842_driver *driver)
-+void *nx842_crypto_alloc_ctx(struct nx842_driver *driver)
- {
--      struct nx842_crypto_ctx *ctx = crypto_tfm_ctx(tfm);
-+      struct nx842_crypto_ctx *ctx;
-+
-+      ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
-+      if (!ctx)
-+              return ERR_PTR(-ENOMEM);
-       spin_lock_init(&ctx->lock);
-       ctx->driver = driver;
-@@ -114,22 +118,23 @@ int nx842_crypto_init(struct crypto_tfm
-               kfree(ctx->wmem);
-               free_page((unsigned long)ctx->sbounce);
-               free_page((unsigned long)ctx->dbounce);
--              return -ENOMEM;
-+              kfree(ctx);
-+              return ERR_PTR(-ENOMEM);
-       }
--      return 0;
-+      return ctx;
- }
--EXPORT_SYMBOL_GPL(nx842_crypto_init);
-+EXPORT_SYMBOL_GPL(nx842_crypto_alloc_ctx);
--void nx842_crypto_exit(struct crypto_tfm *tfm)
-+void nx842_crypto_free_ctx(void *p)
- {
--      struct nx842_crypto_ctx *ctx = crypto_tfm_ctx(tfm);
-+      struct nx842_crypto_ctx *ctx = p;
-       kfree(ctx->wmem);
-       free_page((unsigned long)ctx->sbounce);
-       free_page((unsigned long)ctx->dbounce);
- }
--EXPORT_SYMBOL_GPL(nx842_crypto_exit);
-+EXPORT_SYMBOL_GPL(nx842_crypto_free_ctx);
- static void check_constraints(struct nx842_constraints *c)
- {
-@@ -246,11 +251,11 @@ nospc:
-       return update_param(p, slen, dskip + dlen);
- }
--int nx842_crypto_compress(struct crypto_tfm *tfm,
-+int nx842_crypto_compress(struct crypto_scomp *tfm,
-                         const u8 *src, unsigned int slen,
--                        u8 *dst, unsigned int *dlen)
-+                        u8 *dst, unsigned int *dlen, void *pctx)
- {
--      struct nx842_crypto_ctx *ctx = crypto_tfm_ctx(tfm);
-+      struct nx842_crypto_ctx *ctx = pctx;
-       struct nx842_crypto_header *hdr =
-                               container_of(&ctx->header,
-                                            struct nx842_crypto_header, hdr);
-@@ -431,11 +436,11 @@ usesw:
-       return update_param(p, slen + padding, dlen);
- }
--int nx842_crypto_decompress(struct crypto_tfm *tfm,
-+int nx842_crypto_decompress(struct crypto_scomp *tfm,
-                           const u8 *src, unsigned int slen,
--                          u8 *dst, unsigned int *dlen)
-+                          u8 *dst, unsigned int *dlen, void *pctx)
- {
--      struct nx842_crypto_ctx *ctx = crypto_tfm_ctx(tfm);
-+      struct nx842_crypto_ctx *ctx = pctx;
-       struct nx842_crypto_header *hdr;
-       struct nx842_crypto_param p;
-       struct nx842_constraints c = *ctx->driver->constraints;
---- a/drivers/crypto/nx/nx-842.h
-+++ b/drivers/crypto/nx/nx-842.h
-@@ -101,6 +101,8 @@
- #define LEN_ON_SIZE(pa, size) ((size) - ((pa) & ((size) - 1)))
- #define LEN_ON_PAGE(pa)               LEN_ON_SIZE(pa, PAGE_SIZE)
-+struct crypto_scomp;
-+
- static inline unsigned long nx842_get_pa(void *addr)
- {
-       if (!is_vmalloc_addr(addr))
-@@ -179,13 +181,13 @@ struct nx842_crypto_ctx {
-       struct nx842_driver *driver;
- };
--int nx842_crypto_init(struct crypto_tfm *tfm, struct nx842_driver *driver);
--void nx842_crypto_exit(struct crypto_tfm *tfm);
--int nx842_crypto_compress(struct crypto_tfm *tfm,
-+void *nx842_crypto_alloc_ctx(struct nx842_driver *driver);
-+void nx842_crypto_free_ctx(void *ctx);
-+int nx842_crypto_compress(struct crypto_scomp *tfm,
-                         const u8 *src, unsigned int slen,
--                        u8 *dst, unsigned int *dlen);
--int nx842_crypto_decompress(struct crypto_tfm *tfm,
-+                        u8 *dst, unsigned int *dlen, void *ctx);
-+int nx842_crypto_decompress(struct crypto_scomp *tfm,
-                           const u8 *src, unsigned int slen,
--                          u8 *dst, unsigned int *dlen);
-+                          u8 *dst, unsigned int *dlen, void *ctx);
- #endif /* __NX_842_H__ */
---- a/drivers/crypto/nx/nx-common-powernv.c
-+++ b/drivers/crypto/nx/nx-common-powernv.c
-@@ -9,6 +9,7 @@
- #include "nx-842.h"
-+#include <crypto/internal/scompress.h>
- #include <linux/timer.h>
- #include <asm/prom.h>
-@@ -1034,23 +1035,21 @@ static struct nx842_driver nx842_powernv
-       .decompress =   nx842_powernv_decompress,
- };
--static int nx842_powernv_crypto_init(struct crypto_tfm *tfm)
-+static void *nx842_powernv_crypto_alloc_ctx(void)
- {
--      return nx842_crypto_init(tfm, &nx842_powernv_driver);
-+      return nx842_crypto_alloc_ctx(&nx842_powernv_driver);
- }
--static struct crypto_alg nx842_powernv_alg = {
--      .cra_name               = "842",
--      .cra_driver_name        = "842-nx",
--      .cra_priority           = 300,
--      .cra_flags              = CRYPTO_ALG_TYPE_COMPRESS,
--      .cra_ctxsize            = sizeof(struct nx842_crypto_ctx),
--      .cra_module             = THIS_MODULE,
--      .cra_init               = nx842_powernv_crypto_init,
--      .cra_exit               = nx842_crypto_exit,
--      .cra_u                  = { .compress = {
--      .coa_compress           = nx842_crypto_compress,
--      .coa_decompress         = nx842_crypto_decompress } }
-+static struct scomp_alg nx842_powernv_alg = {
-+      .base.cra_name          = "842",
-+      .base.cra_driver_name   = "842-nx",
-+      .base.cra_priority      = 300,
-+      .base.cra_module        = THIS_MODULE,
-+
-+      .alloc_ctx              = nx842_powernv_crypto_alloc_ctx,
-+      .free_ctx               = nx842_crypto_free_ctx,
-+      .compress               = nx842_crypto_compress,
-+      .decompress             = nx842_crypto_decompress,
- };
- static __init int nx_compress_powernv_init(void)
-@@ -1110,7 +1109,7 @@ static __init int nx_compress_powernv_in
-               nx842_powernv_exec = nx842_exec_vas;
-       }
--      ret = crypto_register_alg(&nx842_powernv_alg);
-+      ret = crypto_register_scomp(&nx842_powernv_alg);
-       if (ret) {
-               nx_delete_coprocs();
-               return ret;
-@@ -1131,7 +1130,7 @@ static void __exit nx_compress_powernv_e
-       if (!nx842_ct)
-               vas_unregister_api_powernv();
--      crypto_unregister_alg(&nx842_powernv_alg);
-+      crypto_unregister_scomp(&nx842_powernv_alg);
-       nx_delete_coprocs();
- }
---- a/drivers/crypto/nx/nx-common-pseries.c
-+++ b/drivers/crypto/nx/nx-common-pseries.c
-@@ -11,6 +11,7 @@
- #include <asm/vio.h>
- #include <asm/hvcall.h>
- #include <asm/vas.h>
-+#include <crypto/internal/scompress.h>
- #include "nx-842.h"
- #include "nx_csbcpb.h" /* struct nx_csbcpb */
-@@ -1006,23 +1007,21 @@ static struct nx842_driver nx842_pseries
-       .decompress =   nx842_pseries_decompress,
- };
--static int nx842_pseries_crypto_init(struct crypto_tfm *tfm)
-+static void *nx842_pseries_crypto_alloc_ctx(void)
- {
--      return nx842_crypto_init(tfm, &nx842_pseries_driver);
-+      return nx842_crypto_alloc_ctx(&nx842_pseries_driver);
- }
--static struct crypto_alg nx842_pseries_alg = {
--      .cra_name               = "842",
--      .cra_driver_name        = "842-nx",
--      .cra_priority           = 300,
--      .cra_flags              = CRYPTO_ALG_TYPE_COMPRESS,
--      .cra_ctxsize            = sizeof(struct nx842_crypto_ctx),
--      .cra_module             = THIS_MODULE,
--      .cra_init               = nx842_pseries_crypto_init,
--      .cra_exit               = nx842_crypto_exit,
--      .cra_u                  = { .compress = {
--      .coa_compress           = nx842_crypto_compress,
--      .coa_decompress         = nx842_crypto_decompress } }
-+static struct scomp_alg nx842_pseries_alg = {
-+      .base.cra_name          = "842",
-+      .base.cra_driver_name   = "842-nx",
-+      .base.cra_priority      = 300,
-+      .base.cra_module        = THIS_MODULE,
-+
-+      .alloc_ctx              = nx842_pseries_crypto_alloc_ctx,
-+      .free_ctx               = nx842_crypto_free_ctx,
-+      .compress               = nx842_crypto_compress,
-+      .decompress             = nx842_crypto_decompress,
- };
- static int nx842_probe(struct vio_dev *viodev,
-@@ -1070,7 +1069,7 @@ static int nx842_probe(struct vio_dev *v
-       if (ret)
-               goto error;
--      ret = crypto_register_alg(&nx842_pseries_alg);
-+      ret = crypto_register_scomp(&nx842_pseries_alg);
-       if (ret) {
-               dev_err(&viodev->dev, "could not register comp alg: %d\n", ret);
-               goto error;
-@@ -1118,7 +1117,7 @@ static void nx842_remove(struct vio_dev
-       if (caps_feat)
-               sysfs_remove_group(&viodev->dev.kobj, &nxcop_caps_attr_group);
--      crypto_unregister_alg(&nx842_pseries_alg);
-+      crypto_unregister_scomp(&nx842_pseries_alg);
-       spin_lock_irqsave(&devdata_mutex, flags);
-       old_devdata = rcu_dereference_check(devdata,
-@@ -1250,7 +1249,7 @@ static void __exit nx842_pseries_exit(vo
-       vas_unregister_api_pseries();
--      crypto_unregister_alg(&nx842_pseries_alg);
-+      crypto_unregister_scomp(&nx842_pseries_alg);
-       spin_lock_irqsave(&devdata_mutex, flags);
-       old_devdata = rcu_dereference_check(devdata,
index 7e63d3be49bfff619473f43943c5aa32192d88d5..5a67e3fd2fab237e49e63a43d733ac9c2561f1bd 100644 (file)
@@ -357,9 +357,6 @@ xfs-fix-a-resource-leak-in-xfs_alloc_buftarg.patch
 udf-fix-partition-descriptor-append-bookkeeping.patch
 hfsplus-fix-uninit-value-by-validating-catalog-record-size.patch
 hfsplus-fix-held-lock-freed-on-hfsplus_fill_super.patch
-crypto-nx-avoid-wflex-array-member-not-at-end-warning.patch
-crypto-nx-migrate-to-scomp-api.patch
-crypto-nx-fix-bounce-buffer-leaks-in-nx842_crypto_-alloc-free-_ctx.patch
 erofs-fix-unsigned-underflow-in-z_erofs_lz4_handle_overlap.patch
 ceph-only-d_add-negative-dentries-when-they-are-unhashed.patch
 printk-add-print_hex_dump_devel.patch
@@ -522,7 +519,6 @@ x86-cpu-amd-move-the-zen3-btc_no-detection-to-the-zen3-init-function.patch
 r8152-hold-the-rtnl_lock-for-all-of-reset.patch
 selftests-bpf-fix-bpf_nf-selftest-failure.patch
 bootconfig-fix-negative-seeks-on-32-bit-with-lfs-enabled.patch
-crypto-nx-fix-context-leak-in-nx842_crypto_free_ctx.patch
 media-rc-ttusbir-fix-inverted-error-logic.patch
 batman-adv-tp_meter-fix-tp_vars-reference-leak-in-receiver-shutdown.patch
 media-rc-igorplugusb-fix-control-request-setup-packet.patch