mirror_zfs/module/icp/algs
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
..
aes Unify Assembler files between Linux and Windows 2023-01-17 11:09:19 -08:00
blake3 Miscellaneous FreBSD compilation bugfixes 2023-04-06 10:35:02 -07:00
edonr Remove unused Edon-R variants 2023-03-14 15:59:58 -07:00
modes icp: Use explicit_memset() exclusively in gcm_clear_ctx() 2025-05-27 14:41:45 -07:00
sha2 module/icp/asm-arm/sha2: enable non-SIMD asm kernels on armv5/6 2024-08-26 15:10:16 -07:00
skein Fix Clang 15 compilation errors 2022-11-30 13:46:26 -08:00