mirror-linux/drivers/crypto/nx
Dan Moulding f75f66683d crypto: comp - Use same definition of context alloc and free ops
In commit 42d9f6c774 ("crypto: acomp - Move scomp stream allocation
code into acomp"), the crypto_acomp_streams struct was made to rely on
having the alloc_ctx and free_ctx operations defined in the same order
as the scomp_alg struct. But in that same commit, the alloc_ctx and
free_ctx members of scomp_alg may be randomized by structure layout
randomization, since they are contained in a pure ops structure
(containing only function pointers). If the pointers within scomp_alg
are randomized, but those in crypto_acomp_streams are not, then
the order may no longer match. This fixes the problem by removing the
union from scomp_alg so that both crypto_acomp_streams and scomp_alg
will share the same definition of alloc_ctx and free_ctx, ensuring
they will always have the same layout.

Signed-off-by: Dan Moulding <dan@danm.net>
Suggested-by: Herbert Xu <herbert@gondor.apana.org.au>
Fixes: 42d9f6c774 ("crypto: acomp - Move scomp stream allocation code into acomp")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2025-09-20 20:21:03 +08:00
..
Kconfig
Makefile crypto: nx - fix build warnings when DEBUG_FS is not enabled 2023-05-24 18:12:33 +08:00
nx-842.c crypto: nx - Migrate to scomp API 2025-03-21 17:39:06 +08:00
nx-842.h crypto: nx - Migrate to scomp API 2025-03-21 17:39:06 +08:00
nx-aes-cbc.c crypto: nx - Add missing header inclusions 2025-04-16 15:16:21 +08:00
nx-aes-ccm.c crypto: nx - use the new scatterwalk functions 2025-03-02 15:19:43 +08:00
nx-aes-ctr.c crypto: nx - Add missing header inclusions 2025-04-16 15:16:21 +08:00
nx-aes-ecb.c crypto: nx - Add missing header inclusions 2025-04-16 15:16:21 +08:00
nx-aes-gcm.c crypto: nx - use the new scatterwalk functions 2025-03-02 15:19:43 +08:00
nx-aes-xcbc.c crypto: nx - Use API partial block handling 2025-04-23 15:52:47 +08:00
nx-common-powernv.c crypto: comp - Use same definition of context alloc and free ops 2025-09-20 20:21:03 +08:00
nx-common-pseries.c crypto: comp - Use same definition of context alloc and free ops 2025-09-20 20:21:03 +08:00
nx-sha256.c crypto: nx - Use API partial block handling 2025-04-23 15:52:47 +08:00
nx-sha512.c crypto: nx - Use API partial block handling 2025-04-23 15:52:47 +08:00
nx.c crypto: nx - Use API partial block handling 2025-04-23 15:52:47 +08:00
nx.h crypto: nx - Use API partial block handling 2025-04-23 15:52:47 +08:00
nx_csbcpb.h
nx_debugfs.c