Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [PATCH v2] smb: client: terminate session upon failed client required signing
@ 2026-02-05  1:00 Aaditya Kansal
  2026-02-15 13:16 ` Aaditya Kansal
  0 siblings, 1 reply; 8+ messages in thread
From: Aaditya Kansal @ 2026-02-05  1:00 UTC (permalink / raw)
  To: sfrench; +Cc: linux-cifs, Aaditya Kansal

Currently, when smb signature verification fails, the behaviour is to log
the failure without any action to terminate the session.

Call cifs_reconnect() when client required signature verification fails.
Otherwise, log the error without reconnecting.

Signed-off-by: Aaditya Kansal <aadityakansal390@gmail.com>
---
Changes in v2:
- reconnect only triggered when client required signature verification fails
---
 fs/smb/client/cifstransport.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/fs/smb/client/cifstransport.c b/fs/smb/client/cifstransport.c
index 28d1cee90625..6c1fbf0bef6d 100644
--- a/fs/smb/client/cifstransport.c
+++ b/fs/smb/client/cifstransport.c
@@ -169,12 +169,18 @@ cifs_check_receive(struct mid_q_entry *mid, struct TCP_Server_Info *server,
 
 		iov[0].iov_base = mid->resp_buf;
 		iov[0].iov_len = len;
-		/* FIXME: add code to kill session */
+
 		rc = cifs_verify_signature(&rqst, server,
 					   mid->sequence_number);
-		if (rc)
+		if (rc) {
 			cifs_server_dbg(VFS, "SMB signature verification returned error = %d\n",
 				 rc);
+
+			if (!(server->sec_mode & SECMODE_SIGN_REQUIRED)) {
+				cifs_reconnect(server, true);
+				return rc;
+			}
+		}
 	}
 
 	/* BB special case reconnect tid and uid here? */
-- 
2.52.0


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

end of thread, other threads:[~2026-02-16  5:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-05  1:00 [PATCH v2] smb: client: terminate session upon failed client required signing Aaditya Kansal
2026-02-15 13:16 ` Aaditya Kansal
2026-02-15 18:31   ` Steve French
2026-02-15 19:23     ` Aaditya Kansal
2026-02-15 21:08       ` Steve French
2026-02-15 22:42         ` Aaditya Kansal
2026-02-16  1:24           ` Steve French
2026-02-16  5:18             ` Aaditya Kansal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox