X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=lttng-syscalls.c;h=5cac721200bb8aa5cab44ffcfa281e380d7ccfe1;hb=bcde0d5b7da973a9372b3db4acc0b08b9589e05b;hp=1489934f3319bbad05de08d3c404f155bd2feac7;hpb=cecef7f86625593d7e26337294ceda7252557f59;p=lttng-modules.git diff --git a/lttng-syscalls.c b/lttng-syscalls.c index 1489934f..5cac7212 100644 --- a/lttng-syscalls.c +++ b/lttng-syscalls.c @@ -1036,6 +1036,8 @@ int lttng_syscall_filter_disable(struct lttng_channel *chan, WARN_ON_ONCE(!chan->sc_table); if (!chan->sc_filter) { + if (!chan->syscall_all) + return -EEXIST; filter = kzalloc(sizeof(struct lttng_syscall_filter), GFP_KERNEL); if (!filter) @@ -1048,6 +1050,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);