]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #3028 in SNORT/snort3 from ~VKAMBALA/snort3:pkt_thread to master
authorBhargava Jandhyala (bjandhya) <bjandhya@cisco.com>
Wed, 18 Aug 2021 05:42:11 +0000 (05:42 +0000)
committerBhargava Jandhyala (bjandhya) <bjandhya@cisco.com>
Wed, 18 Aug 2021 05:42:11 +0000 (05:42 +0000)
Squashed commit of the following:

commit a40f41d770a0cee1d574dfb383a53f622decfad7
Author: krishnakanth <vkambala@cisco.com>
Date:   Tue Aug 17 04:08:06 2021 -0400

    smb: Invoke SMB debug in destructor when packet thread available

src/service_inspectors/dce_rpc/dce_smb2_file.cc
src/service_inspectors/dce_rpc/dce_smb2_request.h
src/service_inspectors/dce_rpc/dce_smb2_session.cc
src/service_inspectors/dce_rpc/dce_smb2_tree.cc
src/service_inspectors/dce_rpc/dce_smb_module.h

index d71fc6e9276c48189711318996081ac85746f5b8..167dff739713864db10e0d07e61d55d3717cefaf 100644 (file)
@@ -242,7 +242,7 @@ bool Dce2Smb2FileTracker::process_data(const uint32_t current_flow_key, const ui
 
 Dce2Smb2FileTracker::~Dce2Smb2FileTracker(void)
 {
-    if (smb_module_is_up)
+    if (smb_module_is_up and (is_packet_thread()))
     {
            SMB_DEBUG(dce_smb_trace, DEFAULT_TRACE_OPTION_ID, TRACE_DEBUG_LEVEL, GET_CURRENT_PACKET, "file tracker %" PRIu64
             " file name hash %" PRIu64 " terminating\n", file_id, file_name_hash);
index 84db1059124ba345ddbd9d917d8d68b53fb15487..32ddc6ff44448cca2eec8ae0231b5f8edaed9b29 100644 (file)
@@ -48,7 +48,7 @@ public:
 
     ~Dce2Smb2RequestTracker()
     {
-        if (smb_module_is_up)
+        if (smb_module_is_up and (snort::is_packet_thread()))
         {
                SMB_DEBUG(dce_smb_trace, DEFAULT_TRACE_OPTION_ID, TRACE_DEBUG_LEVEL, GET_CURRENT_PACKET, "request tracker terminating\n");
         }
index 19eab6bba47e1e43b20bc41bd6bdb02cf5eaa345..f4ad56c70fb2322ce8adfbadc7ef14f9393db545 100644 (file)
@@ -191,7 +191,7 @@ void Dce2Smb2SessionTracker::unlink()
 // Session Tracker is created and destroyed only from session cache
 Dce2Smb2SessionTracker::~Dce2Smb2SessionTracker(void)
 {
-    if (smb_module_is_up)
+    if (smb_module_is_up and (snort::is_packet_thread()))
     {
            SMB_DEBUG(dce_smb_trace, DEFAULT_TRACE_OPTION_ID, 
                TRACE_DEBUG_LEVEL, GET_CURRENT_PACKET,
index e0af17cd31c2202d5b478ca706fd8488f26fa332..1c593071bab2db0e906515cc1f8b7534b1c08cf4 100644 (file)
@@ -528,7 +528,7 @@ void Dce2Smb2TreeTracker::process(uint16_t command, uint8_t command_type,
 
 Dce2Smb2TreeTracker::~Dce2Smb2TreeTracker(void)
 {
-    if (smb_module_is_up)
+    if (smb_module_is_up and (is_packet_thread()))
     {
            SMB_DEBUG(dce_smb_trace, DEFAULT_TRACE_OPTION_ID, TRACE_DEBUG_LEVEL,
                GET_CURRENT_PACKET, "tree tracker %" PRIu32 " terminating\n", tree_id);
@@ -545,14 +545,14 @@ Dce2Smb2TreeTracker::~Dce2Smb2TreeTracker(void)
 
     if (active_requests.size())
     {
-        if (smb_module_is_up)
+        if (smb_module_is_up and (is_packet_thread()))
         {
             SMB_DEBUG(dce_smb_trace, DEFAULT_TRACE_OPTION_ID, TRACE_DEBUG_LEVEL,
                    GET_CURRENT_PACKET, "cleanup pending requests for below MIDs:\n");
         }
         for (auto it_request : active_requests)
         {
-            if (smb_module_is_up)
+            if (smb_module_is_up and (is_packet_thread()))
             {
                        SMB_DEBUG(dce_smb_trace, DEFAULT_TRACE_OPTION_ID, TRACE_DEBUG_LEVEL,
                            GET_CURRENT_PACKET, "mid %" PRIu64 "\n", it_request.first.mid);
index 5d1217af5e9324bd04232aa822be0614c0052600..6b662d49c21963a4003c331c4a18b5e967070d75 100644 (file)
@@ -60,8 +60,8 @@ extern THREAD_LOCAL const snort::Trace* dce_smb_trace;
     "SMB - excessive tree connect requests with pending tree connect responses"
 #define DCE2_SMB_EXCESSIVE_READS_STR  "SMB - excessive read requests with pending read responses"
 #define DCE2_SMB_EXCESSIVE_CHAINING_STR  "SMB - excessive command chaining"
-#define DCE2_SMB_MULT_CHAIN_SS_STR   "SMB - multiple chained tree connect requests"
-#define DCE2_SMB_MULT_CHAIN_TC_STR   "SMB - multiple chained tree connect requests"
+#define DCE2_SMB_MULT_CHAIN_SS_STR   "SMB - Multiple chained login requests"
+#define DCE2_SMB_MULT_CHAIN_TC_STR   "SMB - Multiple chained tree connect requests"
 #define DCE2_SMB_CHAIN_SS_LOGOFF_STR   "SMB - chained/compounded login followed by logoff"
 #define DCE2_SMB_CHAIN_TC_TDIS_STR \
     "SMB - chained/compounded tree connect followed by tree disconnect"