From: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Shirish Pargaonkar
<shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH -v3 3/4 cifs] NTLMv2/NTLMSSP define crypto hash functions and create and send keys needed for key exchange
Date: Wed, 15 Sep 2010 08:37:22 -0400 [thread overview]
Message-ID: <20100915083722.79710462@corrin.poochiereds.net> (raw)
In-Reply-To: <AANLkTik6DO7EVQ7cbG7Vnu3G=hw9kQBPDm5eqEqdVFWq-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
On Tue, 14 Sep 2010 22:38:14 -0500
Shirish Pargaonkar <shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> >> + if (ses->tilen > 0) {
> >> + memcpy(bcc_ptr, ses->tiblob,
> >> + ses->tilen);
> >> + bcc_ptr += ses->tilen;
> >> + kfree(ses->tiblob);
> >> + ses->tilen = 0;
> >> + }
> >> if (ses->capabilities & CAP_UNICODE) {
> >> if (iov[0].iov_len % 2) {
> >> *bcc_ptr = 0;
> >> @@ -815,12 +862,33 @@ ssetup_ntlmssp_authenticate:
> >> if (phase == NtLmNegotiate) {
> >> setup_ntlmssp_neg_req(pSMB, ses);
> >> iov[1].iov_len = sizeof(NEGOTIATE_MESSAGE);
> >> + iov[1].iov_base = &pSMB->req.SecurityBlob[0];
> >> } else if (phase == NtLmAuthenticate) {
> >> int blob_len;
> >> - blob_len = setup_ntlmssp_auth_req(pSMB, ses,
> >> + char *ntlmsspblob;
> >> +
> >> + /* 5 is an empirical value, large enought to
> >> + * hold authenticate message, max 10 of
> >> + * av paris, doamin,user,workstation mames,
> >> + * flags etc..
> >> + */
> >> + ntlmsspblob = kmalloc(5 *
> >> + sizeof(struct _AUTHENTICATE_MESSAGE),
> >> + GFP_KERNEL);
> >
> > ^^^^ when does this get freed?
>
> Sorry, gave a wrong answer.
>
> iov[1].iov_base = ntlmsspblob; So it gets freed after SendReceive2() call after
> that assignment.
That doesn't get automatically freed. That does mean however that you
can't kfree it at the end of that block. One way to fix it would be to
move the ntlmsspblob declaration to the top of the function and kfree
it at function exit.
--
Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
prev parent reply other threads:[~2010-09-15 12:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-13 19:15 [PATCH -v3 3/4 cifs] NTLMv2/NTLMSSP define crypto hash functions and create and send keys needed for key exchange shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w
[not found] ` <1284405339-31226-1-git-send-email-shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2010-09-14 12:33 ` Jeff Layton
[not found] ` <20100914083358.45c05914-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2010-09-14 14:15 ` Shirish Pargaonkar
[not found] ` <AANLkTim_S1kxVGRs-q1kSTAtsEvEE9ey-M2Aeb=yt76k-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-14 14:33 ` Jeff Layton
[not found] ` <20100914103314.55c198ed-4QP7MXygkU+dMjc06nkz3ljfA9RmPOcC@public.gmane.org>
2010-09-14 14:36 ` Shirish Pargaonkar
2010-09-15 3:38 ` Shirish Pargaonkar
[not found] ` <AANLkTik6DO7EVQ7cbG7Vnu3G=hw9kQBPDm5eqEqdVFWq-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-09-15 12:37 ` Jeff Layton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100915083722.79710462@corrin.poochiereds.net \
--to=jlayton-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
--cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=shirishpargaonkar-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.