Bug 5436 - Reports "Server packet had invalid SMB signature" with some Win2K servers
Summary: Reports "Server packet had invalid SMB signature" with some Win2K servers
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.2
Classification: Unclassified
Component: Client tools (show other bugs)
Version: 3.2.0
Hardware: Other Linux
: P3 regression
Target Milestone: ---
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL: http://bugs.debian.org/47973
Keywords:
Depends on:
Blocks:
 
Reported: 2008-05-03 13:47 UTC by Debian samba package maintainers (PUBLIC MAILING LIST)
Modified: 2017-07-16 23:10 UTC (History)
5 users (show)

See Also:


Attachments
Level 10 debug log (55.26 KB, text/plain)
2008-05-03 13:48 UTC, Debian samba package maintainers (PUBLIC MAILING LIST)
no flags Details
smbclient -d10 ... -c "archive 0;recurse;du" (50.02 KB, text/plain)
2008-05-09 09:55 UTC, aragon
no flags Details
Works with 3.0.28: smbclient -d10 ... -c "archive 0;recurse;du" (77.44 KB, text/plain)
2008-05-09 13:26 UTC, aragon
no flags Details
Patch (5.37 KB, patch)
2008-05-13 10:07 UTC, Volker Lendecke
no flags Details
CUPS debug-level error log (36.43 KB, application/zip)
2010-10-28 15:52 UTC, Andrew Baran
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Debian samba package maintainers (PUBLIC MAILING LIST) 2008-05-03 13:47:23 UTC
This bugs was initially reported in Debian for 3.0.28a and our user confirmed he reproduced it with 3.2.0pre3 packages:

When I'm connected to a particular Win2K Server, I get the following 
error for about every command that I send:

backuppc@sylvester:~$  /usr/bin/smbclient \\\\maestro\\DEV -U backkuppc
Password:
Domain=[INTRA] OS=[Windows 5.0] Server=[Windows 2000 LAN Manager]
smb: \> dir
client_check_incoming_message: received message with mid 10 with no 
matching send record.
SMB Signature verification failed on incoming packet!
Server packet had invalid SMB signature! listing \*
Error in dskattr: Server packet had invalid SMB signature!

I use this smbclient with about 20 PCs with various versions of Windows 
and this is the only one that shows that behaviour.

I attached a --debuglevel 10 log to this message for all the details.

Thanks a lot,
GFK's
Comment 1 Debian samba package maintainers (PUBLIC MAILING LIST) 2008-05-03 13:48:25 UTC
Created attachment 3274 [details]
Level 10 debug log
Comment 2 aragon 2008-05-09 08:47:06 UTC
There is a typo in the URL to the Debian bugtracking system.
The correct URL is:
http://bugs.debian.org/479073
Comment 3 aragon 2008-05-09 09:49:44 UTC
Hello,

this bug hits us after updating the debian samba package from 3.0.24-6etch9 to 3.0.28a-2 on our backup server running amanda 2.5.2p1-1. The backup of one partition on our ADS fails during the estimate phase, because smbclient reports the partition as empty. smbclient 3.0.24 correctly reports a size of ~5GB.

Amanda logs de following in sendsize.*.debug:
 time 4.327: calculating for amname //djhuti.datasysteme/E$, dirname //djhuti.datasysteme/E$, spindle 1
 time 4.327: getting size via smbclient for //djhuti.datasysteme/E$ level 0
 time 4.327: spawning /usr/bin/smbclient in pipeline
 time 4.327: argument list: smbclient "\\\\djhuti.datasysteme\\E$" -d 0 -U backup -E -c "archive 0;recurse;du"
 time 4.377: Domain=[DATASYSTEME] OS=[Windows Server 2003 3790 Service Pack 2] Server=[Windows Server 2003 5.2]
 time 4.790: SMB Signature verification failed on incoming packet!
 time 4.791: Error in dskattr: Server packet had invalid SMB signature!
 time 4.792: Total number of bytes: 0
 time 4.792: .....
 time 4.792: estimate time for //djhuti.datasysteme/E$ level 0: 0.465
 time 4.792: possible /usr/bin/smbclient problem -- is "//djhuti.datasysteme/E$" really empty?
 time 4.792: .....
 time 4.792: estimate size for //djhuti.datasysteme/E$ level 0: 0 KB


If I enter the failing command directly I get the following. A level 10 debug output is attached

amun:~# smbclient "\\\\djhuti.datasysteme\\E$" -d 0 -U backup -E -c "archive 0;recurse;du"
Password:
Domain=[DATASYSTEME] OS=[Windows Server 2003 3790 Service Pack 2] Server=[Windows Server 2003 5.2]
SMB Signature verification failed on incoming packet!
Error in dskattr: Server packet had invalid SMB signature!
Total number of bytes: 0

Thanks,
Martin
Comment 4 aragon 2008-05-09 09:55:09 UTC
Created attachment 3283 [details]
smbclient -d10 ... -c "archive 0;recurse;du"

Output of the following failing command:
smbclient -d10 "\\\\djhuti.datasysteme\\E$" -U backup -E -c "archive 0;recurse;du"
Comment 5 aragon 2008-05-09 13:26:45 UTC
Created attachment 3284 [details]
Works with 3.0.28: smbclient -d10 ... -c "archive 0;recurse;du"

After Downgrading Samba to 3.0.28 (without "a") smbclient works as expected.

----------------------------------------------------------
amun:# smbclient "\\\\djhuti.datasysteme\\E$" -U backup -E -c "archive 0;recurse;du"
Password:
Domain=[DATASYSTEME] OS=[Windows Server 2003 3790 Service Pack 2] Server=[Windows Server 2003 5.2]

                49999 blocks of size 1048576. 44598 blocks available
Total number of bytes: 5436955509
-----------------------------------------------------------

I attached the first 2000 lines off the level 10 debug output. The whole log is 2.5MB in size. A "diff -u" shows that the main differences between the logs of 3.0.28a and 3.0.28 starts in line 1274 of this file.

[...]
@@ -1266,20 +1271,362 @@
 [010] 00 69 00 6E 00 67 00 2D  00 32 00 30 00 30 00 38  .i.n.g.- .2.0.0.8
 [020] 00 30 00 33 00 32 00 37  00 2E 00 6C 00 6F 00 67  .0.3.2.7 ...l.o.g
 [030] 00                                                .
-client_check_incoming_message: received message with mid 12 with no matching send record.
-SMB Signature verification failed on incoming packet!
-removed head of do_list_queue (start=71, end=170)
-size=132
+get_sequence_for_reply: found seq = 19 mid = 12
+simple_packet_signature: sequence number 19
+client_check_incoming_message: seq 19: got good SMB signature of
+[000] 54 F2 F3 3D 97 CD 55 1E                           Tòó=.ÍU.
+size=104
[...]


Regards,
Martin
Comment 6 Volker Lendecke 2008-05-13 08:00:51 UTC
Reproduced. Working on a fix.

Thanks for the report!

Volker
Comment 7 Volker Lendecke 2008-05-13 10:07:01 UTC
Created attachment 3288 [details]
Patch

This patch is a combined patch from upstream patches 968ff01d and 660be616.

Volker
Comment 8 Volker Lendecke 2008-05-13 10:07:42 UTC
Closing, for me the issue is solved with the patch just sent. Please re-open if it doesn't. Thanks for reporting!

Volker
Comment 9 Andrew Baran 2010-10-25 12:17:41 UTC
The bug is revealed again in version 2:3.5.5~dfsg-1~bpo50+2.

When downgrading to version 3.2.5-4lenny13, no symptoms observed for Debian Lenny 5.0.6.

Comment 10 Volker Lendecke 2010-10-26 13:04:41 UTC
(In reply to comment #9)
> The bug is revealed again in version 2:3.5.5~dfsg-1~bpo50+2.
> 
> When downgrading to version 3.2.5-4lenny13, no symptoms observed for Debian
> Lenny 5.0.6.
> 

This is also with amanda? I've just tried master against a W2k3 DC, and it seems we don't have a general signing problem. This combination seems to work fine.

Can you please give exact information how you reproduced the issue?

Thanks,

Volker

Comment 11 Andrew Baran 2010-10-28 13:50:46 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > The bug is revealed again in version 2:3.5.5~dfsg-1~bpo50+2.
> > 
> > When downgrading to version 3.2.5-4lenny13, no symptoms observed for Debian
> > Lenny 5.0.6.
> > 
> 
> This is also with amanda? I've just tried master against a W2k3 DC, and it
> seems we don't have a general signing problem. This combination seems to work
> fine.
> 
> Can you please give exact information how you reproduced the issue?
> 
> Thanks,
> 
> Volker
> 

Hi Volker,

Thus, a Windows XP attached HP LaserJet 2300d printer is currently successfully configured for my recently updated Debian Lenny 5.0.6 operating system.

Steps to reproduce the symptoms are as follows:

1) as non-root user belonging to lpadmin group, open Common UNIX Printing System 1.3.8 page at http://localhost:631/admin/
2) go to the Administration page and enable the “Save debugging information for troubleshooting” option.
3) Go to the Printers page and send a test page to the printer.
4) On the Printers page, delete the printer.
4) as root user, uninstall smbclient Version 3.2.5 -- [2:3.2.5-4lenny13]:
	<machine>:/home/<user># apt-get remove smbclient samba-common smbfs cifs-utils

5) install the fresh -- 3.5.5~dfsg-1~bpo50+2 -- version of smbclient from backports.debian.org:

	apt-get -t lenny-backports install smbclient samba-common smbfs cifs-utils

6) in the Samba Server dialog, choose the “Install the package maintainer's version” smb.conf file
7) edit the [global] section of smb.conf to enable:
	printing = cups

	printcap name = cups
8) restart the cups daemon and reload the CUPS Administration page.
9) as the same non-root user, add the printer on the Administration page:
	a) on the Device drop-down list choose “Windows printer via SAMBA”
	b) in the “Device URI” field, enter:
	smb://<user>:<password>@<workgroup><xp_hostname>/HPLaserJ2300d
	c) on the “Set Printer Options” page, enable duplexing 
10) send a test page to the printer. All what the printer is able to output, is the uppmost line of the Printer Test Page picture. On the “HPLaserJ2300d
” page of CUPS Administration, a message “Error writing spool: Server packet had invalid SMB signature!” appears beside the printer title.

Failing to atach (too big) log file, I will try to send it to your mail box.

Sincerely,

Andrew
Comment 12 Andrew Baran 2010-10-28 15:52:12 UTC
Created attachment 6039 [details]
CUPS debug-level error log
Comment 13 Andrew Baran 2010-10-28 16:00:02 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > The bug is revealed again in version 2:3.5.5~dfsg-1~bpo50+2.
> > 
> > When downgrading to version 3.2.5-4lenny13, no symptoms observed for Debian
> > Lenny 5.0.6.
> > 
> 
> This is also with amanda? I've just tried master against a W2k3 DC, and it
> seems we don't have a general signing problem. This combination seems to work
> fine.
> 
> Can you please give exact information how you reproduced the issue?
> 
> Thanks,
> 
> Volker
> 

As a complement to Comment #10, a new attachment containing a debug-level error log has been created.
Comment 14 Andrew Bartlett 2017-07-16 23:10:19 UTC
I'm going to mark this as fixed.  We have come a very long way with our SMB signing code and I think this is now fixed.

Specifically changes like 5d06b2197b5fd95aaf0394d1bdba957bac6c3570 in master for 4.0 and backported to 3.6.