From: Ronnie Sahlberg Date: Thu, 25 Mar 2021 06:26:35 +0000 (+1000) Subject: cifs: revalidate mapping when we open files for SMB1 POSIX X-Git-Tag: v5.10.79~5859 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fee111089cc9fb01e3910c275c1ad51bf3dbc177;p=platform%2Fkernel%2Flinux-rpi.git 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 Reviewed-by: Paulo Alcantara (SUSE) Signed-off-by: Steve French Signed-off-by: Sasha Levin --- diff --git a/fs/cifs/file.c b/fs/cifs/file.c index be46fab..da05757 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -164,6 +164,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); }