Skip to content

Commit c772aa9

Browse files
piastrysmfrench
authored andcommitted
CIFS: Fix wrong buffer pointer usage in smb_set_file_info
Commit 6bdf6db caused a regression in setattr codepath that leads to files with wrong attributes. Signed-off-by: Pavel Shilovsky <piastry@etersoft.ru> Reviewed-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <smfrench@gmail.com>
1 parent 3a98b86 commit c772aa9

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

fs/cifs/smb1ops.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,6 @@ smb_set_file_info(struct inode *inode, const char *full_path,
766766
struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
767767
struct tcon_link *tlink = NULL;
768768
struct cifs_tcon *tcon;
769-
FILE_BASIC_INFO info_buf;
770769

771770
/* if the file is already open for write, just use that fileid */
772771
open_file = find_writable_file(cinode, true);
@@ -817,7 +816,7 @@ smb_set_file_info(struct inode *inode, const char *full_path,
817816
netpid = current->tgid;
818817

819818
set_via_filehandle:
820-
rc = CIFSSMBSetFileInfo(xid, tcon, &info_buf, netfid, netpid);
819+
rc = CIFSSMBSetFileInfo(xid, tcon, buf, netfid, netpid);
821820
if (!rc)
822821
cinode->cifsAttrs = le32_to_cpu(buf->Attributes);
823822

0 commit comments

Comments
 (0)