mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
smb: client: require stable pages for signed connections
When signing, cifs computes the SMB signature over the pagecache folios
in place and then hands those same folios to the socket. If a buffered
write mutates a folio while a write subrequest is still in flight, the
signature no longer matches the data that follows it, the server rejects
the write with STATUS_ACCESS_DENIED (-EACCES), and the error is latched
in the mapping, so the next fsync()/fallocate() returns -EIO.
Mark the mapping for stable writes so netfs_perform_write() waits for
writeback to complete before modifying an in-flight folio. This is
only needed when the connection is signed.
Fixes: 3ee1a1fc39 ("cifs: Cut over to using netfslib")
Reviewed-by: David Howells <dhowells@redhat.com>
Reviewed-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Paulo Alcantara <pc@manguebit.org>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Ronnie Sahlberg <ronniesahlberg@gmail.com>
Cc: Shyam Prasad N <sprasad@microsoft.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Bharath SM <bharathsm@microsoft.com>
Cc: stable@vger.kernel.org
This commit is contained in:
parent
75aa4b4d55
commit
53c5c2c109
|
|
@ -88,6 +88,8 @@ static void cifs_set_ops(struct inode *inode)
|
|||
else
|
||||
inode->i_data.a_ops = &cifs_addr_ops;
|
||||
mapping_set_large_folios(inode->i_mapping);
|
||||
if (tcon->ses->server->sign)
|
||||
mapping_set_stable_writes(inode->i_mapping);
|
||||
break;
|
||||
case S_IFDIR:
|
||||
if (IS_AUTOMOUNT(inode)) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user