net: tls: Pass union tls_crypto_context pointer to memzero_explicit
authorSimon Horman <horms@kernel.org>
Mon, 8 Jul 2024 07:27:19 +0000 (08:27 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 9 Jul 2024 18:14:47 +0000 (11:14 -0700)
commit0d9e699d3421b5db83eb0cb7a708882440ee78ef
tree5da251328712ae25a3d4fbb528e8137eb5bbe64c
parent3699e57aae8817b232c311229ab531ee0ec39fc8
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: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Signed-off-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20240708-tls-memzero-v2-1-9694eaf31b79@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/tls/tls_main.c