]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
netmap: Release lock to avoid deadlock
authorJeff Lucovsky <jeff.lucovsky@corelight.com>
Thu, 8 Feb 2024 14:12:47 +0000 (09:12 -0500)
committerVictor Julien <victor@inliniac.net>
Thu, 15 Feb 2024 14:34:05 +0000 (15:34 +0100)
Issue: 6755

When NetmapOpen encounters an error opening the netmap device, it'll
retry a bit. When the retry limit is reached, it'll shutdown Suricata.

This commit ensures that the device list lock is not held when before
closing all open devices before terminating Suricata.

(cherry picked from commit 364adeeb0442592ceea4d329622ca5fe34bf31fd)

src/source-netmap.c

index 0b04b41b52d64af7edb6fec763aea7db74bcf518..8e409ea00e6f07697a231931a71335b44db0139a 100644 (file)
@@ -453,6 +453,7 @@ retry:
             }
         }
 
+        SCMutexUnlock(&netmap_devlist_lock);
         NetmapCloseAll();
         FatalError("opening devname %s failed: %s", devname, strerror(errno));
     }