Project

General

Profile

Actions

Bug #11659

closed

SMB2 protocol version negotiation needs work

Added by Andrew Stormont almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

No response is emitted when a NEGOTIATE request is received with dialects that are unsupported. This appears to be due to the fact that the response header is not properly initialised. The code also attempts to respond with NT_STATUS_INVALID_PARAMETER:

best_version = smb2_find_best_dialect(s, cl_versions, version_cnt);
if (best_version == 0) {
    cmn_err(CE_NOTE, "clnt %s no supported dialect",
        sr->session->ip_addr_str);
    sr->smb2_status = NT_STATUS_INVALID_PARAMETER;
    rc = -1;
    goto errout;
}

Whereas the correct response is NT_STATUS_NOT_SUPPORTED:

The server MUST select the greatest common dialect between the dialects it implements and the Dialects array of the SMB2 NEGOTIATE request. If a common dialect is not found, the server MUST fail the request with STATUS_NOT_SUPPORTED.

We also do not properly handle the cases where no dialect is given and drop the connection when we should leave it open.

This will be fixed as part of #11665.


Related issues

Related to illumos gate - Bug #11670: SMB2_FLAGS_SIGNED is not valid during NEGOTIATEClosed

Actions
Related to illumos gate - Bug #11665: SMB2 NEGOTIATE Security Mode handling is wrongClosed

Actions
Actions

Also available in: Atom PDF