All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cifs: Use kzfree() to free password
@ 2018-12-20 11:32 Dan Carpenter
  2018-12-20 13:01 ` Paulo Alcantara
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Dan Carpenter @ 2018-12-20 11:32 UTC (permalink / raw)
  To: kernel-janitors

We should zero out the password before we free it.

Fixes: 3d6cacbb5310 ("cifs: Add DFS cache routines")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
 fs/cifs/dfs_cache.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/cifs/dfs_cache.c b/fs/cifs/dfs_cache.c
index f74567788396..006333146a6d 100644
--- a/fs/cifs/dfs_cache.c
+++ b/fs/cifs/dfs_cache.c
@@ -1130,7 +1130,7 @@ static int dup_vol(struct smb_vol *vol, struct smb_vol *new)
 err_free_unc:
 	kfree(new->UNC);
 err_free_password:
-	kfree(new->password);
+	kzfree(new->password);
 err_free_username:
 	kfree(new->username);
 	kfree(new);
-- 
2.17.1

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

* Re: [PATCH] cifs: Use kzfree() to free password
  2018-12-20 11:32 [PATCH] cifs: Use kzfree() to free password Dan Carpenter
@ 2018-12-20 13:01 ` Paulo Alcantara
  2018-12-20 16:58 ` Steve French
  2018-12-21  6:19 ` Steve French
  2 siblings, 0 replies; 4+ messages in thread
From: Paulo Alcantara @ 2018-12-20 13:01 UTC (permalink / raw)
  To: kernel-janitors

Dan Carpenter <dan.carpenter@oracle.com> writes:

> We should zero out the password before we free it.
>
> Fixes: 3d6cacbb5310 ("cifs: Add DFS cache routines")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  fs/cifs/dfs_cache.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/dfs_cache.c b/fs/cifs/dfs_cache.c
> index f74567788396..006333146a6d 100644
> --- a/fs/cifs/dfs_cache.c
> +++ b/fs/cifs/dfs_cache.c
> @@ -1130,7 +1130,7 @@ static int dup_vol(struct smb_vol *vol, struct smb_vol *new)
>  err_free_unc:
>  	kfree(new->UNC);
>  err_free_password:
> -	kfree(new->password);
> +	kzfree(new->password);
>  err_free_username:
>  	kfree(new->username);
>  	kfree(new);
> -- 
> 2.17.1

Reviewed-by: Paulo Alcantara <palcantara@suse.de>

Thanks!
Paulo

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

* Re: [PATCH] cifs: Use kzfree() to free password
  2018-12-20 11:32 [PATCH] cifs: Use kzfree() to free password Dan Carpenter
  2018-12-20 13:01 ` Paulo Alcantara
@ 2018-12-20 16:58 ` Steve French
  2018-12-21  6:19 ` Steve French
  2 siblings, 0 replies; 4+ messages in thread
From: Steve French @ 2018-12-20 16:58 UTC (permalink / raw)
  To: kernel-janitors

Good catch

On Thu, Dec 20, 2018 at 6:15 AM Dan Carpenter via samba-technical
<samba-technical@lists.samba.org> wrote:
>
> We should zero out the password before we free it.
>
> Fixes: 3d6cacbb5310 ("cifs: Add DFS cache routines")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
>  fs/cifs/dfs_cache.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/cifs/dfs_cache.c b/fs/cifs/dfs_cache.c
> index f74567788396..006333146a6d 100644
> --- a/fs/cifs/dfs_cache.c
> +++ b/fs/cifs/dfs_cache.c
> @@ -1130,7 +1130,7 @@ static int dup_vol(struct smb_vol *vol, struct smb_vol *new)
>  err_free_unc:
>         kfree(new->UNC);
>  err_free_password:
> -       kfree(new->password);
> +       kzfree(new->password);
>  err_free_username:
>         kfree(new->username);
>         kfree(new);
> --
> 2.17.1
>
>


-- 
Thanks,

Steve

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

* Re: [PATCH] cifs: Use kzfree() to free password
  2018-12-20 11:32 [PATCH] cifs: Use kzfree() to free password Dan Carpenter
  2018-12-20 13:01 ` Paulo Alcantara
  2018-12-20 16:58 ` Steve French
@ 2018-12-21  6:19 ` Steve French
  2 siblings, 0 replies; 4+ messages in thread
From: Steve French @ 2018-12-21  6:19 UTC (permalink / raw)
  To: kernel-janitors

merged into cifs-2.6.git for-next

On Thu, Dec 20, 2018 at 10:07 AM Paulo Alcantara <palcantara@suse.de> wrote:
>
> Dan Carpenter <dan.carpenter@oracle.com> writes:
>
> > We should zero out the password before we free it.
> >
> > Fixes: 3d6cacbb5310 ("cifs: Add DFS cache routines")
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> >  fs/cifs/dfs_cache.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/fs/cifs/dfs_cache.c b/fs/cifs/dfs_cache.c
> > index f74567788396..006333146a6d 100644
> > --- a/fs/cifs/dfs_cache.c
> > +++ b/fs/cifs/dfs_cache.c
> > @@ -1130,7 +1130,7 @@ static int dup_vol(struct smb_vol *vol, struct smb_vol *new)
> >  err_free_unc:
> >       kfree(new->UNC);
> >  err_free_password:
> > -     kfree(new->password);
> > +     kzfree(new->password);
> >  err_free_username:
> >       kfree(new->username);
> >       kfree(new);
> > --
> > 2.17.1
>
> Reviewed-by: Paulo Alcantara <palcantara@suse.de>
>
> Thanks!
> Paulo



-- 
Thanks,

Steve

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

end of thread, other threads:[~2018-12-21  6:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-20 11:32 [PATCH] cifs: Use kzfree() to free password Dan Carpenter
2018-12-20 13:01 ` Paulo Alcantara
2018-12-20 16:58 ` Steve French
2018-12-21  6:19 ` Steve French

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.