Re: [PATCH 1/4] smb: server: Clear sensitive stack and heap data in auth.c

Namjae Jeon <[email protected]>
Newsgroups org.kernel.vger.linux-cifs,org.kernel.vger.linux-kernel
Message-ID <CAKYAXd-W2D_oMsdEXTB18Evovh7V_1d=TaSpxBtaOyjNb_byxw@mail.gmail.com>
> @@ -464,7 +466,7 @@ int ksmbd_krb5_authenticate(struct ksmbd_session *sess, char *in_blob,
>         *out_len = resp->spnego_blob_len;
>         retval = 0;
>  out:
> -       kvfree(resp);
> +       kvfree_sensitive(resp, sizeof(*resp));
The flexible payload[] array contains the session key and AP-REP data,
which would remain in memory after the free. Please clear the complete
allocation:

          kvfree_sensitive(resp, sizeof(*resp) + resp->session_key_len
+ resp->spnego_blob_len);

Thanks!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.