seccomp: we should control NO_NEW_PRIVS on our own, not let seccomp do this for us
This commit is contained in:
parent
fe6b2d55bc
commit
7c66bae2ff
|
@ -969,30 +969,30 @@ static int apply_seccomp(ExecContext *c) {
|
||||||
r = seccomp_arch_add(seccomp, PTR_TO_UINT32(id) - 1);
|
r = seccomp_arch_add(seccomp, PTR_TO_UINT32(id) - 1);
|
||||||
if (r == -EEXIST)
|
if (r == -EEXIST)
|
||||||
continue;
|
continue;
|
||||||
if (r < 0) {
|
if (r < 0)
|
||||||
seccomp_release(seccomp);
|
goto finish;
|
||||||
return r;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
|
|
||||||
|
} else {
|
||||||
r = seccomp_add_secondary_archs(seccomp);
|
r = seccomp_add_secondary_archs(seccomp);
|
||||||
if (r < 0) {
|
if (r < 0)
|
||||||
seccomp_release(seccomp);
|
goto finish;
|
||||||
return r;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
action = c->syscall_whitelist ? SCMP_ACT_ALLOW : negative_action;
|
action = c->syscall_whitelist ? SCMP_ACT_ALLOW : negative_action;
|
||||||
SET_FOREACH(id, c->syscall_filter, i) {
|
SET_FOREACH(id, c->syscall_filter, i) {
|
||||||
r = seccomp_rule_add(seccomp, action, PTR_TO_INT(id) - 1, 0);
|
r = seccomp_rule_add(seccomp, action, PTR_TO_INT(id) - 1, 0);
|
||||||
if (r < 0) {
|
if (r < 0)
|
||||||
seccomp_release(seccomp);
|
goto finish;
|
||||||
return r;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
r = seccomp_attr_set(seccomp, SCMP_FLTATR_CTL_NNP, 0);
|
||||||
|
if (r < 0)
|
||||||
|
goto finish;
|
||||||
|
|
||||||
r = seccomp_load(seccomp);
|
r = seccomp_load(seccomp);
|
||||||
|
|
||||||
|
finish:
|
||||||
seccomp_release(seccomp);
|
seccomp_release(seccomp);
|
||||||
|
|
||||||
return r;
|
return r;
|
||||||
|
|
Loading…
Reference in a new issue