From: Mathieu Desnoyers Date: Wed, 24 Sep 2014 01:02:51 +0000 (-0400) Subject: Fix: syscall: fail disable all if all already disabled X-Git-Tag: v2.6.0-rc1~24 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=404e87bf6e1a448d1b6a93c2b67b801f039235f3;p=lttng-modules.git Fix: syscall: fail disable all if all already disabled Signed-off-by: Mathieu Desnoyers --- diff --git a/lttng-syscalls.c b/lttng-syscalls.c index 1489934f..00584e3e 100644 --- a/lttng-syscalls.c +++ b/lttng-syscalls.c @@ -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);