]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Ensure we exit on smbd_smb2_process_negprot() fail.
authorJeremy Allison <jra@samba.org>
Tue, 26 Nov 2019 20:17:29 +0000 (12:17 -0800)
committerKarolin Seeger <kseeger@samba.org>
Mon, 16 Dec 2019 08:22:36 +0000 (08:22 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14205

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit a2d81d77c111379cbb6bd732c717307974eace0a)

source3/smbd/process.c

index 99693ed1315b98360ca164439b33d061d703b9a2..4cd431bd01714bd54b5d92893a8326543ddfa1bd 100644 (file)
@@ -1961,7 +1961,14 @@ static void process_smb(struct smbXsrv_connection *xconn,
                if (smbd_is_smb2_header(inbuf, nread)) {
                        const uint8_t *inpdu = inbuf + NBT_HDR_SIZE;
                        size_t pdulen = nread - NBT_HDR_SIZE;
-                       smbd_smb2_process_negprot(xconn, 0, inpdu, pdulen);
+                       NTSTATUS status = smbd_smb2_process_negprot(
+                                               xconn,
+                                               0,
+                                               inpdu,
+                                               pdulen);
+                       if (!NT_STATUS_IS_OK(status)) {
+                               exit_server_cleanly("SMB2 negprot fail");
+                       }
                        return;
                }
                if (nread >= smb_size && valid_smb_header(inbuf)