Linux CIFS filesystem development
 help / color / mirror / Atom feed
* Signature check for LOGOFF response
@ 2022-03-19  3:20 Enzo Matsumiya
  2022-03-19 12:28 ` Tom Talpey
  0 siblings, 1 reply; 7+ messages in thread
From: Enzo Matsumiya @ 2022-03-19  3:20 UTC (permalink / raw)
  To: samba-technical, linux-cifs; +Cc: smfrench

Hi,

The LOGOFF command response is not signed (=> signature is 0x0), but we
check it anyway, displaying "sign fail" errors in ring buffer.

As far as I checked, an explicit LOGOUT is only sent when tlink pruning
happens (i.e. TLINK_IDLE_EXPIRE expires), but we have a case of this
causing issues on production env.

I didn't find LOGOFF being a signature check exception in MS-SMB2 rev64.
Relevant sections:

2.2.7 SMB2 LOGOFF Request
2.2.8 SMB2 LOGOFF Response
3.2.5.4 Receiving an SMB2 LOGOFF Response
3.3.5.6 Receiving an SMB2 LOGOFF Request

If this is implementation defined, maybe something like this could work?
(100% untested)

--- a/fs/cifs/smb2transport.c
+++ b/fs/cifs/smb2transport.c
@@ -667,6 +667,7 @@ smb2_verify_signature(struct smb_rqst *rqst, struct TCP_Server_Info *server)
         if ((shdr->Command == SMB2_NEGOTIATE) ||
             (shdr->Command == SMB2_SESSION_SETUP) ||
             (shdr->Command == SMB2_OPLOCK_BREAK) ||
+           (shdr->Command == SMB2_LOGOFF) ||
             server->ignore_signature ||
             (!server->session_estab))
                 return 0;

Thoughts?


Enzo

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

end of thread, other threads:[~2022-03-24 18:52 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-03-19  3:20 Signature check for LOGOFF response Enzo Matsumiya
2022-03-19 12:28 ` Tom Talpey
2022-03-23 17:29   ` Enzo Matsumiya
2022-03-24 15:04     ` Tom Talpey
2022-03-24 16:23       ` Jeremy Allison
2022-03-24 18:48         ` Tom Talpey
2022-03-24 18:52           ` Jeremy Allison

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