linux/include/crypto/internal
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
..
acompress.h crypto: acomp - Fix CFI failure due to type punning 2025-07-18 20:52:00 +10:00
aead.h crypto: aead - Use crypto_request_complete 2023-02-13 18:34:48 +08:00
akcipher.h crypto: akcipher - Drop sign/verify operations 2024-10-05 13:22:04 +08:00
blake2b.h crypto: arm/blake2b - Use API partial block handling 2025-04-23 11:33:46 +08:00
blake2s.h crypto: blake2s - remove shash module 2022-06-10 16:43:49 +08:00
blockhash.h crypto: lib/sha256 - Move partial block handling out 2025-05-05 13:32:01 +08:00
cipher.h crypto: cipher - Add crypto_clone_cipher 2023-05-24 18:12:33 +08:00
des.h crypto: remove CRYPTO_TFM_RES_WEAK_KEY 2020-01-09 11:30:53 +08:00
ecc.h This update includes the following changes: 2024-11-19 10:28:41 -08:00
engine.h crypto: engine - remove {prepare,unprepare}_crypt_hardware callbacks 2025-07-18 20:52:00 +10:00
geniv.h crypto: geniv - use memcpy_sglist() instead of null skcipher 2025-05-12 13:32:53 +08:00
hash.h crypto: ahash - Add crypto_ahash_tested() helper function 2025-06-26 18:52:33 +08:00
kdf_selftest.h crypto: kdf - Add key derivation self-test support code 2021-11-26 16:25:17 +11:00
kpp.h crypto: kpp - Use crypto_request_complete 2023-02-13 18:34:48 +08:00
poly1305.h crypto: lib/poly1305 - Add block-only interface 2025-05-05 13:32:50 +08:00
rng.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
rsa.h crypto: rsassa-pkcs1 - Migrate to sig_alg backend 2024-10-05 13:22:04 +08:00
scompress.h crypto: comp - Use same definition of context alloc and free ops 2025-09-20 20:21:03 +08:00
sig.h crypto: sig - Introduce sig_alg backend 2024-10-05 13:22:04 +08:00
simd.h crypto: testmgr - reinstate kconfig control over full self-tests 2025-06-13 17:24:21 +08:00
skcipher.h crypto: scatterwalk - Move skcipher walk and use it for memcpy_sglist 2025-04-28 19:45:26 +08:00