Re: [PATCH] cifs: fix potential use-after-free in cifs_oplock_break_put

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

 



On 11/10/2010 08:49 PM, Jeff Layton wrote:
> cfile may very well be freed after the cifsFileInfo_put. Make sure we
> have a valid pointer to the superblock for cifs_sb_deactive.
> 
> Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
> ---
>  fs/cifs/file.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
> index 06c3e83..b857ce5 100644
> --- a/fs/cifs/file.c
> +++ b/fs/cifs/file.c
> @@ -2271,8 +2271,10 @@ void cifs_oplock_break_get(struct cifsFileInfo *cfile)
>  
>  void cifs_oplock_break_put(struct cifsFileInfo *cfile)
>  {
> +	struct super_block *sb = cfile->dentry->d_sb;
> +
>  	cifsFileInfo_put(cfile);
> -	cifs_sb_deactive(cfile->dentry->d_sb);
> +	cifs_sb_deactive(sb);
>  }
>  

Looks correct to me.

Reviewed-by: Suresh Jayaraman <sjayaraman@xxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux