所以让我们假设我有一个这样的简单程序:
#include <seccomp.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
int main(void) {
scmp_filter_ctx ctx;
int ret = 0;
ctx = seccomp_init(SCMP_ACT_ALLOW);
ret |= seccomp_rule_add(ctx, SCMP_ACT_KILL, SCMP_SYS(write), 0);
ret |= seccomp_load(ctx);
if (ret) {
exit(ret);
}
// some more stuff
execve("/bin/sh", NULL, NULL);
}
是否可以不继承对 execve 产生的进程的限制?(我们正在谈论配置,我不想在 execve 调用之前再调用任何与 seccomp 相关的东西)