]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
analyze: fix offline check for syscal filter 22926/head
authorLuca Boccassi <bluca@debian.org>
Thu, 31 Mar 2022 23:54:53 +0000 (00:54 +0100)
committerLuca Boccassi <bluca@debian.org>
Fri, 1 Apr 2022 09:42:48 +0000 (10:42 +0100)
The deny/allow list check was inverted, if we are deny listing and the
hashmap contains the syscall then that's good

Fixes https://github.com/systemd/systemd/issues/22914

src/analyze/analyze-security.c

index 61e5e71ba65723d1aea565bd45c1d1ceec9291cd..cfda6580a7ce1eab9081927da021a9ce1aa252b7 100644 (file)
@@ -590,7 +590,7 @@ static bool syscall_names_in_filter(Hashmap *s, bool allow_list, const SyscallFi
                 if (id < 0)
                         continue;
 
-                if (hashmap_contains(s, syscall) == allow_list) {
+                if (hashmap_contains(s, syscall) != allow_list) {
                         log_debug("Offending syscall filter item: %s", syscall);
                         if (ret_offending_syscall)
                                 *ret_offending_syscall = syscall;