2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-31 14:25:49 +00:00

test: setuid in seccomp_filter test to have it fail

Signed-off-by: Tycho Andersen <tycho.andersen@canonical.com>
Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
This commit is contained in:
Tycho Andersen
2015-12-16 09:15:08 -07:00
committed by Pavel Emelyanov
parent 1da9760dfe
commit 267519c9fb

View File

@@ -100,16 +100,7 @@ int main(int argc, char ** argv)
if (filter_syscall(__NR_getpid) < 0)
_exit(1);
/* FIXME: seccomp requires a task to be root in its user ns in
* order to install filters for security reasons, so that
* unprivileged parents cannot take over privileged childen.
* However, we restore euids before we restore seccomp filters,
* so if someone does a setuid(1000) here, the restore will
* fail. We need to reorder some things so that the other creds
* restore takes place after seccomp state is set; except that
* the tasks need to be ptraced so the seccomp filters
* potentially don't kill the task for calling setuid().
*/
setuid(1000);
zdtm_seccomp = 1;
test_msg("SECCOMP_MODE_FILTER is enabled\n");