Patch "smb: client: fix double put of @cfile in smb2_rename_path()" has been added to the 6.10-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    smb: client: fix double put of @cfile in smb2_rename_path()

to the 6.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     smb-client-fix-double-put-of-cfile-in-smb2_rename_pa.patch
and it can be found in the queue-6.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit ac18f2db5391f6773896297c520b38e04622ea44
Author: Paulo Alcantara <pc@xxxxxxxxxxxxx>
Date:   Tue Sep 3 10:53:23 2024 -0300

    smb: client: fix double put of @cfile in smb2_rename_path()
    
    [ Upstream commit 3523a3df03c6f04f7ea9c2e7050102657e331a4f ]
    
    If smb2_set_path_attr() is called with a valid @cfile and returned
    -EINVAL, we need to call cifs_get_writable_path() again as the
    reference of @cfile was already dropped by previous smb2_compound_op()
    call.
    
    Fixes: 71f15c90e785 ("smb: client: retry compound request without reusing lease")
    Signed-off-by: Paulo Alcantara (Red Hat) <pc@xxxxxxxxxxxxx>
    Cc: David Howells <dhowells@xxxxxxxxxx>
    Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/smb/client/smb2inode.c b/fs/smb/client/smb2inode.c
index 2a2847601f26..11a1c53c64e0 100644
--- a/fs/smb/client/smb2inode.c
+++ b/fs/smb/client/smb2inode.c
@@ -1106,6 +1106,8 @@ int smb2_rename_path(const unsigned int xid,
 				  co, DELETE, SMB2_OP_RENAME, cfile, source_dentry);
 	if (rc == -EINVAL) {
 		cifs_dbg(FYI, "invalid lease key, resending request without lease");
+		cifs_get_writable_path(tcon, from_name,
+				       FIND_WR_WITH_DELETE, &cfile);
 		rc = smb2_set_path_attr(xid, tcon, from_name, to_name, cifs_sb,
 				  co, DELETE, SMB2_OP_RENAME, cfile, NULL);
 	}




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux