All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Resolve data corruption of TCP server info fields
@ 2020-10-08 14:39 Rohith Surabattula
  2020-10-08 18:19 ` Aurélien Aptel
  2020-10-08 20:36 ` Steve French
  0 siblings, 2 replies; 13+ messages in thread
From: Rohith Surabattula @ 2020-10-08 14:39 UTC (permalink / raw)
  To: Steve French, Shyam Prasad N, Pavel Shilovsky, sribhat.msa,
	linux-cifs

[-- Attachment #1: Type: text/plain, Size: 694 bytes --]

Hi All,

With the "esize" mount option, I observed data corruption and cifs
reconnects during performance tests.

TCP server info field server->total_read is modified parallely by
demultiplex thread and decrypt offload worker thread. server->total_read
is used in calculation to discard the remaining data of PDU which is
not read into memory.

Because of parallel modification, “server->total_read” value got
corrupted and instead of discarding the remaining data, it discarded
some valid data from the next PDU.

server->total_read field is already updated properly during read from
socket. So, no need to update the same field again after decryption.

Regards,
Rohith

[-- Attachment #2: 0001-Resolve-data-corruption-of-TCP-server-info-fields.patch --]
[-- Type: application/octet-stream, Size: 1066 bytes --]

From 8bb9241f4afa414366f2b6c7c1f5981b9ece190e Mon Sep 17 00:00:00 2001
From: Rohith Surabattula <rohiths@microsoft.com>
Date: Thu, 8 Oct 2020 09:58:41 +0000
Subject: [PATCH] Resolve data corruption of TCP server info fields

TCP server info field server->total_read is modified parallely by
demultiplex thread and decrypt offload worker thread. server->total_read
is used in calculation to discard the remaining data of PDU which is
not read into memory.

Because of parallel modification, server->total_read can get corrupted
and can result in discarding the valid data of next PDU.

Signed-off-by: Rohith Surabattula <rohiths@microsoft.com>
---
 fs/cifs/smb2ops.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index 32f90dc82c84..5a15301b80a8 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -4129,8 +4129,6 @@ decrypt_raw_data(struct TCP_Server_Info *server, char *buf,
 
 	memmove(buf, iov[1].iov_base, buf_data_size);
 
-	server->total_read = buf_data_size + page_data_size;
-
 	return rc;
 }
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2020-10-21 23:27 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-08 14:39 [PATCH] Resolve data corruption of TCP server info fields Rohith Surabattula
2020-10-08 18:19 ` Aurélien Aptel
2020-10-08 20:36 ` Steve French
2020-10-14 22:47   ` Pavel Shilovsky
2020-10-15  3:20     ` Rohith Surabattula
2020-10-15 16:09       ` Pavel Shilovsky
2020-10-19  7:28         ` Rohith Surabattula
2020-10-19 16:48           ` Pavel Shilovsky
2020-10-20 21:43             ` Pavel Shilovsky
2020-10-20 22:08               ` Steve French
2020-10-21 21:03                 ` Pavel Shilovsky
2020-10-21 22:59                   ` Steve French
2020-10-21 23:27                     ` Pavel Shilovsky

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.