Re: [PATCH 1/5] smb: client: Clear sensitive stack data in smb2transport.c

From: Thomas Huth

Date: Tue Aug 18 2026 - 02:30:17 EST


On 18/08/2026 07.47, Namjae Jeon wrote:
struct derivation {
@@ -482,6 +485,7 @@ smb3_calc_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
memset(shdr->Signature, 0x0, SMB2_SIGNATURE_SIZE);

rc = aes_cmac_preparekey(&cmac_key, key, SMB2_CMACAES_SIZE);
+ memzero_explicit(key, sizeof(key));
cmac_key is not zeroized, and cmac_ctx is not zeroized on error paths
in smb3_calc_signature(). Please zeroize both on all exit paths,
taking care not to clear an uninitialized context.
Hi!

The cmac_key and cmac_ctx have just been handled via the new __cleanup() functions, that's why I did not add these to this patch here. The patch has just been merged:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=2b240733f27c8dd7e192f36540a10dcb88339222

Thomas