From edef954c3a3c19a6050e947c049b97571ea40822 Mon Sep 17 00:00:00 2001 From: lifubang Date: Thu, 25 Sep 2025 09:41:27 +0000 Subject: [PATCH] test: runc run with personality syscall blocked by seccomp Signed-off-by: lifubang (cherry picked from commit 57f1bef4226e0bc94189610d4cccb1d5aafca19e) Signed-off-by: lifubang --- tests/integration/personality.bats | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/integration/personality.bats b/tests/integration/personality.bats index 37aa8e86f..94e2ac1b2 100644 --- a/tests/integration/personality.bats +++ b/tests/integration/personality.bats @@ -62,3 +62,21 @@ function teardown() { [ "$status" -eq 0 ] [[ "$output" == *"x86_64"* ]] } + +# check that personality can be set when the personality syscall is blocked by seccomp +@test "runc run with personality syscall blocked by seccomp" { + update_config ' + .linux.personality = { + "domain": "LINUX", + } + | .linux.seccomp = { + "defaultAction":"SCMP_ACT_ALLOW", + "syscalls":[{"names":["personality"], "action":"SCMP_ACT_ERRNO"}] + }' + + runc run -d --console-socket "$CONSOLE_SOCKET" test_busybox + [ "$status" -eq 0 ] + runc exec test_busybox /bin/sh -c "uname -a" + [ "$status" -eq 0 ] + [[ "$output" == *"x86_64"* ]] +}