diff mbox

CIFS: Fix wrong buffer pointer usage in smb_set_file_info

Message ID 1354102074-24841-1-git-send-email-piastry@etersoft.ru (mailing list archive)
State New, archived
Headers show

Commit Message

Pavel Shilovsky Nov. 28, 2012, 11:27 a.m. UTC
Commit 6bdf6dbd662176c0da5c3ac8ed10ac94e7776c85 caused a regression
in setattr codepath that leads to files with wrong attributes.

Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
---
 fs/cifs/smb1ops.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Jeff Layton Nov. 28, 2012, 11:39 a.m. UTC | #1
On Wed, 28 Nov 2012 15:27:54 +0400
Pavel Shilovsky <piastry@etersoft.ru> wrote:

> Commit 6bdf6dbd662176c0da5c3ac8ed10ac94e7776c85 caused a regression
> in setattr codepath that leads to files with wrong attributes.
> 
> Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru>
> ---
>  fs/cifs/smb1ops.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
> index 77295f2..561547f 100644
> --- a/fs/cifs/smb1ops.c
> +++ b/fs/cifs/smb1ops.c
> @@ -735,7 +735,6 @@ smb_set_file_info(struct inode *inode, const char *full_path,
>  	struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
>  	struct tcon_link *tlink = NULL;
>  	struct cifs_tcon *tcon;
> -	FILE_BASIC_INFO info_buf;
>  
>  	/* if the file is already open for write, just use that fileid */
>  	open_file = find_writable_file(cinode, true);
> @@ -787,7 +786,7 @@ smb_set_file_info(struct inode *inode, const char *full_path,
>  	netpid = current->tgid;
>  
>  set_via_filehandle:
> -	rc = CIFSSMBSetFileInfo(xid, tcon, &info_buf, netfid, netpid);
> +	rc = CIFSSMBSetFileInfo(xid, tcon, buf, netfid, netpid);
>  	if (!rc)
>  		cinode->cifsAttrs = le32_to_cpu(buf->Attributes);
>  

I agree that this should go into 3.7 as soon as possible.

Reviewed-by: Jeff Layton <jlayton@redhat.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
index 77295f2..561547f 100644
--- a/fs/cifs/smb1ops.c
+++ b/fs/cifs/smb1ops.c
@@ -735,7 +735,6 @@  smb_set_file_info(struct inode *inode, const char *full_path,
 	struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
 	struct tcon_link *tlink = NULL;
 	struct cifs_tcon *tcon;
-	FILE_BASIC_INFO info_buf;
 
 	/* if the file is already open for write, just use that fileid */
 	open_file = find_writable_file(cinode, true);
@@ -787,7 +786,7 @@  smb_set_file_info(struct inode *inode, const char *full_path,
 	netpid = current->tgid;
 
 set_via_filehandle:
-	rc = CIFSSMBSetFileInfo(xid, tcon, &info_buf, netfid, netpid);
+	rc = CIFSSMBSetFileInfo(xid, tcon, buf, netfid, netpid);
 	if (!rc)
 		cinode->cifsAttrs = le32_to_cpu(buf->Attributes);