Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
Commit 0d9e699d authored by Simon Horman's avatar Simon Horman Committed by Jakub Kicinski
Browse files

net: tls: Pass union tls_crypto_context pointer to memzero_explicit


Pass union tls_crypto_context pointer, rather than struct
tls_crypto_info pointer, to memzero_explicit().

The address of the pointer is the same before and after.
But the new construct means that the size of the dereferenced pointer type
matches the size being zeroed. Which aids static analysis.

As reported by Smatch:

  .../tls_main.c:842 do_tls_setsockopt_conf() error: memzero_explicit() 'crypto_info' too small (4 vs 56)

No functional change intended.
Compile tested only.

Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240708-tls-memzero-v2-1-9694eaf31b79@kernel.org


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 3699e57a
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment