Skip to content

Commit 57f1bef

Browse files
committed
test: runc run with personality syscall blocked by seccomp
Signed-off-by: lifubang <[email protected]>
1 parent f7dda6e commit 57f1bef

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/integration/personality.bats

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,21 @@ function teardown() {
6262
[ "$status" -eq 0 ]
6363
[[ "$output" == *"x86_64"* ]]
6464
}
65+
66+
# check that personality can be set when the personality syscall is blocked by seccomp
67+
@test "runc run with personality syscall blocked by seccomp" {
68+
update_config '
69+
.linux.personality = {
70+
"domain": "LINUX",
71+
}
72+
| .linux.seccomp = {
73+
"defaultAction":"SCMP_ACT_ALLOW",
74+
"syscalls":[{"names":["personality"], "action":"SCMP_ACT_ERRNO"}]
75+
}'
76+
77+
runc run -d --console-socket "$CONSOLE_SOCKET" test_busybox
78+
[ "$status" -eq 0 ]
79+
runc exec test_busybox /bin/sh -c "uname -a"
80+
[ "$status" -eq 0 ]
81+
[[ "$output" == *"x86_64"* ]]
82+
}

0 commit comments

Comments
 (0)