From 74f801c485568e59d0d6e3feb8a8ed47b0b900a9 Mon Sep 17 00:00:00 2001 From: virusdefender Date: Thu, 21 Mar 2019 07:55:22 +0800 Subject: [PATCH] add dup / dup2 / dup3 --- src/rules/c_cpp.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/rules/c_cpp.c b/src/rules/c_cpp.c index 757cf8d..fd77c53 100644 --- a/src/rules/c_cpp.c +++ b/src/rules/c_cpp.c @@ -46,6 +46,15 @@ int _c_cpp_seccomp_rules(struct config *_config, bool allow_write_file) { if (seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(open), 0) != 0) { return LOAD_SECCOMP_FAILED; } + if (seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(dup), 0) != 0) { + return LOAD_SECCOMP_FAILED; + } + if (seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(dup2), 0) != 0) { + return LOAD_SECCOMP_FAILED; + } + if (seccomp_rule_add(ctx, SCMP_ACT_ALLOW, SCMP_SYS(dup3), 0) != 0) { + return LOAD_SECCOMP_FAILED; + } } if (seccomp_load(ctx) != 0) { return LOAD_SECCOMP_FAILED;