mirror_zfs/module/icp
Richard Yao d8a33bc0a5
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
2025-05-19 10:04:05 -07:00
..
algs icp: Use explicit_memset() exclusively in gcm_clear_ctx() 2025-05-19 10:04:05 -07:00
api SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
asm-aarch64 SPDX: license tags: Apache-2.0 2025-03-13 17:57:05 -07:00
asm-arm/sha2 SPDX: license tags: Apache-2.0 2025-03-13 17:57:05 -07:00
asm-ppc64 SPDX: license tags: Apache-2.0 2025-03-13 17:57:05 -07:00
asm-x86_64 SPDX: license tags: OpenSSL-standalone 2025-03-13 17:57:27 -07:00
core SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
include SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
io SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
spi SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00
illumos-crypto.c SPDX: license tags: CDDL-1.0 2025-03-13 17:56:27 -07:00