cifs: revalidate mapping when we open files for SMB1 POSIX
authorRonnie Sahlberg <lsahlber@redhat.com>
Thu, 25 Mar 2021 06:26:35 +0000 (16:26 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Apr 2021 11:36:10 +0000 (13:36 +0200)
commitfee111089cc9fb01e3910c275c1ad51bf3dbc177
treeeb59bb19594aca1317904e8306e4db485e448018
parent42498ee672968931921d1b42b86997e21a3d5b8d
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@redhat.com>
Reviewed-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/cifs/file.c