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

From: Namjae Jeon

Date: Tue Aug 18 2026 - 03:48:34 EST


On Tue, Aug 18, 2026 at 3:27 PM Thomas Huth <thuth@xxxxxxxxxx> wrote:
>
> 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
Okay. I will apply this patch-set to #for-next.
Thanks!