Re: [PATCH] cifs: Use kzfree() to free password

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dan Carpenter <dan.carpenter@xxxxxxxxxx> 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@xxxxxxxxxx>
> ---
>  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@xxxxxxx>

Thanks!
Paulo



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux