]> 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>
Sat, 10 Feb 2024 21:29:51 +0000 (22:29 +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.

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));
     }