Bug 12776 - smbclient NT_STATUS_INVALID_PARAMETER uploading to NetApp filer
smbclient NT_STATUS_INVALID_PARAMETER uploading to NetApp filer
Status: NEW
Product: Samba 4.1 and newer
Classification: Unclassified
Component: Tools
unspecified
All All
: P5 normal
: ---
Assigned To: Jeremy Allison
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2017-05-06 01:49 UTC by Buck Huppmann
Modified: 2017-05-30 14:54 UTC (History)
3 users (show)

See Also:


Attachments
my dirty patch (2.65 KB, patch)
2017-05-06 01:49 UTC, Buck Huppmann
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Buck Huppmann 2017-05-06 01:49:33 UTC
Created attachment 13194 [details]
my dirty patch

Hi

When our folks started using ubuntu 14.04 at work,
with its samba 4.3.11-based package, smbclient up-
loads to NetApp filers started to fail with
NT_STATUS_INVALID_PARAMETER. I think it's
specifically when the file to be uploaded is > 64k

Doing some wireshark-ing, it seems that the newer
smbclient is transmitting a writeAndX with a size
parameter of > 64k, whereas the older clients
(3.6.23-based) that don't upset the NetApp always
limit writes to < 64k

Thiat's with SMB1/NT1, no encryption and no signing,
i believe

I'm guessing this happened when the max write size
limit of CLI_WINDOWS_MAX_LARGE_WRITEX_SIZE got
nixed, so that smbclient is now seeing the NetApp's
advertised CAP_LARGE_WRITEX and feeling free to
send it writes accordingly large (up to around
0x1ffff bytes, if i'm reading the code right)

Whether or not it's the Right Thing to Do, i patched
libsmb to clamp the write size to 64k when the
server identifies itself as SpinStream2, like our
NetApps (Data ONTAP 8.something) do, and it works,
for smbclient

Attached is the patch against master, as of a couple
days ago, though i haven't tried compiling it, much
less running and testing it

Not that i think this is worthy of applying. It just
demonstrates the problem we have, or at least how we
could fix it, and maybe it'll be of use to anybody
else with the same problem (google produces a few
reports) who's desperate enough to use it