Skip to content

Commit

Permalink
netmap: Release lock to avoid deadlock
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jlucovsky committed Feb 9, 2024
1 parent 7e4dba7 commit bcd00f5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/source-netmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ static int NetmapOpen(NetmapIfaceSettings *ns, NetmapDevice **pdevice, int verbo
}
}

SCMutexUnlock(&netmap_devlist_lock);
NetmapCloseAll();
FatalError("opening devname %s failed: %s", devname, strerror(errno));
}
Expand Down

0 comments on commit bcd00f5

Please sign in to comment.