mirror_zfs/module/icp
Richard Yao 050517c41b icp: Use explicit_memset() exclusively in gcm_clear_ctx()
d634d20d1b had been intended to fix a
potential information leak issue where the compiler's optimization
passes appeared to remove `memset()` operations that sanitize sensitive
data before memory is freed for use by the rest of the kernel.

When I wrote it, I had assumed that the compiler would not remove the
other `memset()` operations, but upon reflection, I have realized that
this was a bad assumption to make. I would rather have a very slight
amount of additional overhead when calling `gcm_clear_ctx()` than risk a
future compiler remove `memset()` calls. This is likely to happen if
someone decides to try doing link time optimization and the person will
not think to audit the assembly output for issues like this, so it is
best to preempt the possibility before it happens.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Rob Norris <robn@despairlabs.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Signed-off-by: Richard Yao <richard@ryao.dev>
Closes #17343
(cherry picked from commit d8a33bc0a5)
2025-05-27 14:41:45 -07:00
..
algs icp: Use explicit_memset() exclusively in gcm_clear_ctx() 2025-05-27 14:41:45 -07:00
api Cleanup: Remove unnecessary explicit casts of pointers from allocators 2023-01-12 15:59:12 -08:00
asm-aarch64 Do no use .cfi_negate_ra_state within the assembly on Arm64 2024-04-29 13:50:05 -07:00
asm-arm/sha2 module/icp/asm-arm/sha2: enable non-SIMD asm kernels on armv5/6 2024-08-26 15:10:16 -07:00
asm-ppc64 powerpc64: Support ELFv2 asm on Big Endian 2023-04-27 12:49:21 -07:00
asm-x86_64 Restore ASMABI and other Unify work 2023-03-06 15:24:05 -08:00
core Cleanup: Remove unneeded semicolons 2023-01-12 16:00:30 -08:00
include Add generic implementation handling and SHA2 impl 2023-03-02 13:52:21 -08:00
io Use memset to zero stack allocations containing unions 2024-07-17 14:54:47 -07:00
spi Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00
illumos-crypto.c Replace dead opensolaris.org license link 2022-07-11 14:16:13 -07:00