On Wed, May 06, 2020 at 10:03:44AM -0700, Jeremy Allison via samba-technical wrote: > On Wed, May 06, 2020 at 04:08:03PM +0200, Stefan Metzmacher wrote: > > > > smbclient is just smart enough to recover itself from the short read. > > But the windows client isn't. > > Well we pay attention to the amount of data returned > and only increment the next read request by the amount > actually returned. > > I'm amazed that the Windows client doesn't seem to > check this ! Confirmed. I just ran a copy test from a Windows10 client copying from Samba with the attached patch applied (when reading from offset zero, reduce the amount of data returned by 2 bytes to force a short read return), and it reliably corrupts files. Windows isn't looking at the DataLength field of the SMB2_READ response :-(.