All of lore.kernel.org
 help / color / mirror / Atom feed
* re: cifs: Split lanman auth from CIFS_SessSetup()
@ 2014-07-07 11:41 Dan Carpenter
  2014-07-14 16:02 ` Sachin Prabhu
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2014-07-07 11:41 UTC (permalink / raw)
  To: sprabhu-H+wXaHxf7aLQT0dZR+AlfA
  Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA,
	samba-technical-w/Ol4Ecudpl8XjKLYN78aQ

Hello Sachin Prabhu,

The patch 4b26c7b1fc36: "cifs: Split lanman auth from
CIFS_SessSetup()" from Jun 16, 2014, leads to the following static
checker warning:

	fs/cifs/sess.c:797 CIFS_SessSetup()
	warn: possible memory leak of 'sess_data'

fs/cifs/sess.c
   784          sess_data = kzalloc(sizeof(struct sess_data), GFP_KERNEL);
   785          if (!sess_data)
   786                  return -ENOMEM;
   787          sess_data->xid = xid;
   788          sess_data->ses = ses;
   789          sess_data->buf0_type = CIFS_NO_BUFFER;
   790          sess_data->nls_cp = (struct nls_table *) nls_cp;
   791  
   792          type = select_sectype(ses->server, ses->sectype);
   793          cifs_dbg(FYI, "sess setup type %d\n", type);
   794          if (type == Unspecified) {
   795                  cifs_dbg(VFS,
   796                          "Unable to select appropriate authentication method!");
   797                  return -EINVAL;
                        ^^^^^^^^^^^^^^
missing kfree().

   798          }

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: cifs: Split lanman auth from CIFS_SessSetup()
  2014-07-07 11:41 cifs: Split lanman auth from CIFS_SessSetup() Dan Carpenter
@ 2014-07-14 16:02 ` Sachin Prabhu
  0 siblings, 0 replies; 2+ messages in thread
From: Sachin Prabhu @ 2014-07-14 16:02 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: linux-cifs-u79uwXL29TY76Z2rM5mHXA,
	samba-technical-w/Ol4Ecudpl8XjKLYN78aQ

On Mon, 2014-07-07 at 14:41 +0300, Dan Carpenter wrote:
> Hello Sachin Prabhu,
> 
> The patch 4b26c7b1fc36: "cifs: Split lanman auth from
> CIFS_SessSetup()" from Jun 16, 2014, leads to the following static
> checker warning:
> 
> 	fs/cifs/sess.c:797 CIFS_SessSetup()
> 	warn: possible memory leak of 'sess_data'
> 
> fs/cifs/sess.c
>    784          sess_data = kzalloc(sizeof(struct sess_data), GFP_KERNEL);
>    785          if (!sess_data)
>    786                  return -ENOMEM;
>    787          sess_data->xid = xid;
>    788          sess_data->ses = ses;
>    789          sess_data->buf0_type = CIFS_NO_BUFFER;
>    790          sess_data->nls_cp = (struct nls_table *) nls_cp;
>    791  
>    792          type = select_sectype(ses->server, ses->sectype);
>    793          cifs_dbg(FYI, "sess setup type %d\n", type);
>    794          if (type == Unspecified) {
>    795                  cifs_dbg(VFS,
>    796                          "Unable to select appropriate authentication method!");
>    797                  return -EINVAL;
>                         ^^^^^^^^^^^^^^
> missing kfree().
> 
>    798          }
> 
> regards,
> dan carpenter
> --

Hello Dan,

This is indeed a bug. This was however fixed in a patch which came in
later in the series. This patch replaces CIFS_SessSetup(). 
https://git.samba.org/?p=sfrench/cifs-2.6.git;a=commit;h=f877b1fa0ebe6074694721562072106d542e44e1

It looks like the patch wasn't included in Steve's test tree when you
ran your tests. I believe we no longer require a fix for this particular
issue in Steve's tree which now contains the entire series.

Sachin Prabhu

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-14 16:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-07 11:41 cifs: Split lanman auth from CIFS_SessSetup() Dan Carpenter
2014-07-14 16:02 ` Sachin Prabhu

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.