mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 06:03:57 +08:00
test: add "runc run --no-pivot must not expose bare /proc"
For preventing regression like #2647 Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp> Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
committed by
Kir Kolyshkin
parent
17de6f803d
commit
f5c345c30c
@@ -0,0 +1,22 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load helpers
|
||||
|
||||
function setup() {
|
||||
teardown_busybox
|
||||
setup_busybox
|
||||
}
|
||||
|
||||
function teardown() {
|
||||
teardown_busybox
|
||||
}
|
||||
|
||||
@test "runc run --no-pivot must not expose bare /proc" {
|
||||
requires root
|
||||
|
||||
update_config '.process.args |= ["unshare", "-mrpf", "sh", "-euxc", "mount -t proc none /proc && echo h > /proc/sysrq-trigger"]'
|
||||
|
||||
runc run --no-pivot test_no_pivot
|
||||
[ "$status" -eq 1 ]
|
||||
[[ "$output" == *"mount: permission denied"* ]]
|
||||
}
|
||||
Reference in New Issue
Block a user