CVE-2023-3347: smbd: inline smb2_srv_init_signing() code in srv_init_signing()
authorRalph Boehme <slow@samba.org>
Wed, 21 Jun 2023 13:10:58 +0000 (15:10 +0200)
committerJule Anger <janger@samba.org>
Fri, 21 Jul 2023 12:05:35 +0000 (12:05 +0000)
It's now a one-line function, imho the overall code is simpler if that code is
just inlined.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15397

Signed-off-by: Ralph Boehme <slow@samba.org>
source3/smbd/proto.h
source3/smbd/smb2_signing.c

index 3884617e77b55023ca8bd67ac1201afd1e96c5c2..78e1b48be09bcca41c3c87da45ff39ff5af96920 100644 (file)
@@ -52,8 +52,6 @@ struct dcesrv_context;
 
 /* The following definitions come from smbd/smb2_signing.c */
 
-bool smb2_srv_init_signing(struct loadparm_context *lp_ctx,
-                          struct smbXsrv_connection *conn);
 bool srv_init_signing(struct smbXsrv_connection *conn);
 
 /* The following definitions come from smbd/aio.c  */
index c1f876f9cd74eaaf1ba9a1b2b0464d7bf2f59374..ef4a54d5710762fd80c53c7cab4ed4dce6bcf81b 100644 (file)
 #include "lib/param/param.h"
 #include "smb2_signing.h"
 
-bool smb2_srv_init_signing(struct loadparm_context *lp_ctx,
-                          struct smbXsrv_connection *conn)
-{
-       /*
-        * For SMB2 all we need to know is if signing is mandatory.
-        * It is always allowed and desired, whatever the smb.conf says.
-        */
-       (void)lpcfg_server_signing_allowed(lp_ctx, &conn->smb2.signing_mandatory);
-       return true;
-}
-
 bool srv_init_signing(struct smbXsrv_connection *conn)
 {
        struct loadparm_context *lp_ctx = NULL;
-       bool ok;
+       bool ok = true;
 
        lp_ctx = loadparm_init_s3(conn, loadparm_s3_helpers());
        if (lp_ctx == NULL) {
@@ -51,7 +40,11 @@ bool srv_init_signing(struct smbXsrv_connection *conn)
 #if defined(WITH_SMB1SERVER)
        if (conn->protocol >= PROTOCOL_SMB2_02) {
 #endif
-               ok = smb2_srv_init_signing(lp_ctx, conn);
+               /*
+                * For SMB2 all we need to know is if signing is mandatory.
+                * It is always allowed and desired, whatever the smb.conf says.
+                */
+               (void)lpcfg_server_signing_allowed(lp_ctx, &conn->smb2.signing_mandatory);
 #if defined(WITH_SMB1SERVER)
        } else {
                ok = smb1_srv_init_signing(lp_ctx, conn);