[SCM] Samba Shared Repository - branch master updated

Jeremy Allison jra at samba.org
Wed Oct 3 15:48:02 MDT 2012


The branch, master has been updated
       via  fe38a93 Correct fix for bug #9222 - smbd ignores the "server signing = no" setting for SMB2.
       via  49a3357 Revert "Fix bug #9222 - smbd ignores the "server signing = no" setting for SMB2."
       via  c2f5b24 Fix bug #9214 - Bad user supplied SMB2 credit value can cause smbd to call smb_panic.
      from  3983515 s3-docs: add delete_lost option to vfs_streams_depot.8

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit fe38a93c71d0adc0be1d43b438ac3b54eaf4ba53
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Oct 3 12:58:00 2012 -0700

    Correct fix for bug #9222 - smbd ignores the "server signing = no" setting for SMB2.
    
    Signing cannot be disabled for SMB2 by design, so fix the documentation
    instead.
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Wed Oct  3 23:47:23 CEST 2012 on sn-devel-104

commit 49a335731a7139a5c66be596f3d544bef72a8556
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Oct 3 12:50:42 2012 -0700

    Revert "Fix bug #9222 - smbd ignores the "server signing = no" setting for SMB2."
    
    This reverts commit dfd3c31a3f9eea96854b2d22574856368e86b245.
    
    As Metze pointed out:
    
    From MS-SMB2 section 2.2.4:
    
    SMB2_NEGOTIATE_SIGNING_ENABLED
    
    When set, indicates that security signatures are enabled
    on the server. The server MUST set this bit, and the client MUST return
    STATUS_INVALID_NETWORK_RESPONSE if the flag is missing.
    
    I'll submit a documentation bug to fix #9222 that way.

commit c2f5b2466bb05939c953341517da6d9df814b27c
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Oct 2 17:30:54 2012 -0700

    Fix bug #9214 - Bad user supplied SMB2 credit value can cause smbd to call smb_panic.
    
    Terminate the connection cleanly instead.

-----------------------------------------------------------------------

Summary of changes:
 docs-xml/smbdotconf/security/serversigning.xml |   17 +++++++++++------
 source3/smbd/smb2_negprot.c                    |   10 ++++------
 source3/smbd/smb2_server.c                     |    7 ++++++-
 source3/smbd/smb2_sesssetup.c                  |    6 ------
 4 files changed, 21 insertions(+), 19 deletions(-)


Changeset truncated at 500 lines:

diff --git a/docs-xml/smbdotconf/security/serversigning.xml b/docs-xml/smbdotconf/security/serversigning.xml
index ea21a2c..0aced5d 100644
--- a/docs-xml/smbdotconf/security/serversigning.xml
+++ b/docs-xml/smbdotconf/security/serversigning.xml
@@ -5,14 +5,19 @@
 		 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc">
 <description>
 
-    <para>This controls whether the client is allowed or required to use SMB signing. Possible values 
-    are <emphasis>auto</emphasis>, <emphasis>mandatory</emphasis> 
-    and <emphasis>disabled</emphasis>. 
+    <para>This controls whether the client is allowed or required to use SMB1 and SMB2 signing. Possible values
+    are <emphasis>auto</emphasis>, <emphasis>mandatory</emphasis>
+    and <emphasis>disabled</emphasis>.
     </para>
 
-    <para>When set to auto, SMB signing is offered, but not enforced. 
-    When set to mandatory, SMB signing is required and if set 
-	to disabled, SMB signing is not offered either.</para>
+    <para>When set to auto, SMB1 signing is offered, but not enforced.
+    When set to mandatory, SMB1 signing is required and if set
+    to disabled, SMB signing is not offered either.</para>
+
+    <para>For the SMB2 protocol, by design, signing cannot be disabled. In the case
+    where SMB2 is negotiated, if this parameter is set to <emphasis>disabled</emphasis>,
+    it will be treated as <emphasis>auto</emphasis>. Setting it to <emphasis>mandatory</emphasis>
+    will still require SMB2 clients to use signing.</para>
 </description>
 
 <value type="default">Disabled</value>
diff --git a/source3/smbd/smb2_negprot.c b/source3/smbd/smb2_negprot.c
index 826e0d1..6adc581 100644
--- a/source3/smbd/smb2_negprot.c
+++ b/source3/smbd/smb2_negprot.c
@@ -92,7 +92,7 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req)
 	DATA_BLOB security_buffer;
 	size_t expected_dyn_size = 0;
 	size_t c;
-	uint16_t security_mode = 0;
+	uint16_t security_mode;
 	uint16_t dialect_count;
 	uint16_t in_security_mode;
 	uint32_t in_capabilities;
@@ -244,11 +244,9 @@ NTSTATUS smbd_smb2_request_process_negprot(struct smbd_smb2_request *req)
 		return smbd_smb2_request_error(req, NT_STATUS_INTERNAL_ERROR);
 	}
 
-	if (lp_server_signing() != SMB_SIGNING_OFF) {
-		security_mode = SMB2_NEGOTIATE_SIGNING_ENABLED;
-		if (lp_server_signing() == SMB_SIGNING_REQUIRED) {
-			security_mode |= SMB2_NEGOTIATE_SIGNING_REQUIRED;
-		}
+	security_mode = SMB2_NEGOTIATE_SIGNING_ENABLED;
+	if (lp_server_signing() == SMB_SIGNING_REQUIRED) {
+		security_mode |= SMB2_NEGOTIATE_SIGNING_REQUIRED;
 	}
 
 	capabilities = 0;
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index dcaefb1..d92302e 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -780,7 +780,12 @@ static void smb2_set_operation_credit(struct smbd_server_connection *sconn,
 	out_status = NT_STATUS(IVAL(outhdr, SMB2_HDR_STATUS));
 
 	SMB_ASSERT(sconn->smb2.max_credits >= sconn->smb2.credits_granted);
-	SMB_ASSERT(sconn->smb2.max_credits >= credit_charge);
+
+	if (sconn->smb2.max_credits < credit_charge) {
+		smbd_server_connection_terminate(sconn,
+			"client error: credit charge > max credits\n");
+		return;
+	}
 
 	if (out_flags & SMB2_HDR_FLAG_ASYNC) {
 		/*
diff --git a/source3/smbd/smb2_sesssetup.c b/source3/smbd/smb2_sesssetup.c
index 8bdfd49..2599d2a 100644
--- a/source3/smbd/smb2_sesssetup.c
+++ b/source3/smbd/smb2_sesssetup.c
@@ -185,12 +185,6 @@ static NTSTATUS smbd_smb2_auth_generic_return(struct smbXsrv_session *session,
 	struct smbXsrv_session *x = session;
 	struct smbXsrv_connection *conn = session->connection;
 
-	if ((lp_server_signing() == SMB_SIGNING_OFF) &&
-			(in_security_mode & SMB2_NEGOTIATE_SIGNING_REQUIRED)) {
-		DEBUG(0,("SMB2 signing required and we have disabled it.\n"));
-		return NT_STATUS_ACCESS_DENIED;
-	}
-
 	if ((in_security_mode & SMB2_NEGOTIATE_SIGNING_REQUIRED) ||
 	    lp_server_signing() == SMB_SIGNING_REQUIRED) {
 		x->global->signing_required = true;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list