]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
seccomp: Check if syscall is supported on compat architecture. 3548/head
authorRuben Jenster <r.jenster@drachenfels.de>
Tue, 13 Oct 2020 14:51:55 +0000 (16:51 +0200)
committerRuben Jenster <r.jenster@drachenfels.de>
Tue, 13 Oct 2020 15:21:50 +0000 (17:21 +0200)
Signed-off-by: Ruben Jenster <r.jenster@drachenfels.de>
src/lxc/seccomp.c

index 06296f5d94a6e743d834660d3c63333b04f986b8..61b9954a8640ac814d364db633c061abf6dcfda5 100644 (file)
@@ -531,6 +531,11 @@ static bool do_resolve_add_rule(uint32_t arch, char *line, scmp_filter_ctx ctx,
                return true;
        }
 
+       if (arch != SCMP_ARCH_NATIVE && seccomp_syscall_resolve_name_arch(arch, line) < 0) {
+               INFO("The syscall \"%s\" nr:%d is not supported on compat arch:%d", line, nr, arch);
+               return true;
+       }
+
        memset(&arg_cmp, 0, sizeof(arg_cmp));
        for (i = 0; i < rule->args_num; i++) {
                INFO("arg_cmp[%d]: SCMP_CMP(%u, %llu, %llu, %llu)", i,