]> git.ipfire.org Git - thirdparty/suricata.git/commit
multi-tenant: fix coverity warning
authorVictor Julien <vjulien@oisf.net>
Tue, 13 Feb 2024 08:51:15 +0000 (09:51 +0100)
committerVictor Julien <victor@inliniac.net>
Wed, 14 Feb 2024 16:19:36 +0000 (17:19 +0100)
commit2d7c3d8d5970c0629f2358ab91ed895328efa112
tree18872644d52be905b487d55324abf4b71a4b2d33
parentf9a20dafc6abe2c03dea98286c86430b447d8196
multi-tenant: fix coverity warning

Rework locking logic to avoid the following coverity warning.

** CID 1591966:  Concurrent data access violations  (MISSING_LOCK)
/src/detect-engine-loader.c: 475 in DetectLoadersSync()

    474                     SCCtrlMutexLock(loader->tv->ctrl_mutex);
    >>>     CID 1591966:  Concurrent data access violations  (MISSING_LOCK)
    >>>     Accessing "loader->tv" without holding lock "DetectLoaderControl_.m". Elsewhere, "DetectLoaderControl_.tv" is written to with "DetectLoaderControl_.m" held 1 out of 1 times (1 of these accesses strongly imply that it is necessary).
    475                     pthread_cond_broadcast(loader->tv->ctrl_cond);
    476                     SCCtrlMutexUnlock(loader->tv->ctrl_mutex);

The warning itself is harmless.
src/detect-engine-loader.c
src/detect-engine-loader.h