Patch "cifs: revalidate mapping when we open files for SMB1 POSIX" has been added to the 4.9-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

    cifs: revalidate mapping when we open files for SMB1 POSIX

to the 4.9-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:
     cifs-revalidate-mapping-when-we-open-files-for-smb1-.patch
and it can be found in the queue-4.9 subdirectory.

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



commit 85bede79a539163fa59f030537ff9916cc269f80
Author: Ronnie Sahlberg <lsahlber@xxxxxxxxxx>
Date:   Thu Mar 25 16:26:35 2021 +1000

    cifs: revalidate mapping when we open files for SMB1 POSIX
    
    [ Upstream commit cee8f4f6fcabfdf229542926128e9874d19016d5 ]
    
    RHBZ: 1933527
    
    Under SMB1 + POSIX, if an inode is reused on a server after we have read and
    cached a part of a file, when we then open the new file with the
    re-cycled inode there is a chance that we may serve the old data out of cache
    to the application.
    This only happens for SMB1 (deprecated) and when posix are used.
    The simplest solution to avoid this race is to force a revalidate
    on smb1-posix open.
    
    Signed-off-by: Ronnie Sahlberg <lsahlber@xxxxxxxxxx>
    Reviewed-by: Paulo Alcantara (SUSE) <pc@xxxxxx>
    Signed-off-by: Steve French <stfrench@xxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 24508b69e78b..e2ce90fc504e 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -163,6 +163,7 @@ int cifs_posix_open(char *full_path, struct inode **pinode,
 			goto posix_open_ret;
 		}
 	} else {
+		cifs_revalidate_mapping(*pinode);
 		cifs_fattr_to_inode(*pinode, &fattr);
 	}
 



[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