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>
Fri, 13 Dec 2019 10:36:15 +0000 (10:36 +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 177cb3cc5056b325da87d80c1d8893f237fa912d..7c45a648b77d99ad87984c762ebd708fcf885ba6 100644 (file)
@@ -1969,7 +1969,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)