cifsd-team / ksmbd

ksmbd kernel server(SMB/CIFS server)
152 stars 23 forks source link

cifsd: make spnego depend on the "extended security" bit in flags2 #438

Closed xdarklight closed 3 years ago

xdarklight commented 3 years ago

The SMB header has a flag and flags2 field where the client sends the capabilities that it supports. The server is then supposed to respond to this accordingly.

When bit 11 is set in flags2 then "Extended Security Negotiation" is enabled. In this case we are supposed to use spnego. When that field is absent however spnego should be disabled.

The samba server for example does this: if (req->smb_conn->negotiate.encrypted_passwords && (req->flags2 & FLAGS2_EXTENDED_SECURITY)) negotiate_spnego = true;

Fixes #436 for me

namjaejeon commented 3 years ago

Wow, Looks great! Applied, Thanks for your patch!