Fix: syscall: fail disable all if all already disabled
[lttng-modules.git] / lttng-syscalls.c
index 1489934f3319bbad05de08d3c404f155bd2feac7..00584e3eb2ed907cbe241b42756fe345ad5fc512 100644 (file)
@@ -1048,6 +1048,14 @@ int lttng_syscall_filter_disable(struct lttng_channel *chan,
        }
 
        if (!name) {
+               /* Fail if all syscalls are already disabled. */
+               if (bitmap_empty(filter->sc, NR_syscalls)
+                       && bitmap_empty(filter->sc_compat,
+                               NR_compat_syscalls)) {
+                       ret = -EEXIST;
+                       goto error;
+               }
+
                /* Disable all system calls */
                bitmap_clear(filter->sc, 0, NR_syscalls);
                bitmap_clear(filter->sc_compat, 0, NR_compat_syscalls);
This page took 0.023907 seconds and 4 git commands to generate.