Skip to content

Commit

Permalink
ksmbd: use aead_request_free to match aead_request_alloc
Browse files Browse the repository at this point in the history
Use aead_request_free() instead of kfree() to properly free memory
allocated by aead_request_alloc(). This ensures sensitive crypto data
is zeroed before being freed.

Fixes: e2f3448 ("cifsd: add server-side procedures for SMB3")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
  • Loading branch information
Miaoqian Lin authored and Steve French committed Mar 28, 2025
1 parent 1a81ea7 commit 6171063
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/smb/server/auth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,7 @@ int ksmbd_crypt_message(struct ksmbd_work *work, struct kvec *iov,
free_sg:
kfree(sg);
free_req:
kfree(req);
aead_request_free(req);
free_ctx:
ksmbd_release_crypto_ctx(ctx);
return rc;
Expand Down

0 comments on commit 6171063

Please sign in to comment.