11806 SMB server sends malformed responses on error

Review Request #2392 — Created Oct. 11, 2019 and submitted

andy_js
illumos-gate
11806
general
gwr

The SMB2 dispatch code can emit partially constructed responses if a request handler returns SDRC_ERROR. This is easily observed over WireShark when running the WPTS (Windows Protocol Test Suites). One particular test case shows this very clearly: the InvalidCreateRequestStructureSize test found in the CreateClose section.

Ran WPTS and observed the traffic with WireShark. After applying the fix the SMB server no longer sends malformed responses.

  • 0
  • 0
  • 1
  • 0
  • 1
Description From Last Updated
vgusev
  1. Ship It!
  2. 
      
gwr
  1. Also, I don't see it in the bug, but can you please attach an example of the malformatted packet?
    I'd also like to see analysis of what's wrong with the packet and how that happened.
    e.g. did we neglect to put some data after the header by not calling puterror, or what?

    Thanks

    1. I've attached an example to the ticket. And yes, I think that was the problem.

  2. The intent with testing smb2_status == 0
    was that some handlers might set that.
    I'd suggest instead just adding the
    smb2sr_put_error after the if body,
    and pass sr->smb2_status instead.

  3. 
      
andy_js
gwr
  1. 
      
  2. 
      
gdamore
  1. Ship It!
  2. 
      
andy_js
Review request changed

Status: Closed (submitted)

Loading...