[PATCH] wireguard: use memzero_explicit() when zeroing handshake key material
Jason A. Donenfeld
Jason at zx2c4.com
Mon Mar 23 18:31:28 UTC 2026
On Mon, Mar 23, 2026 at 6:42 PM Jeroen Robben <jeroen at robben.io> wrote:
>
> Replace memset() calls in handshake_zero() with memzero_explicit()
> to ensure clearing handshake state is not optimized away by the compiler.
Why would the compiler do this? These aren't some stack variables that
are never touched again subsequently. It's zeroing out some members of
a pointer that lives elsewhere.
More information about the WireGuard
mailing list