mirror of
https://github.com/opencontainers/runc.git
synced 2026-07-11 14:13:58 +08:00
f5c345c30c
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>
23 lines
444 B
Bash
23 lines
444 B
Bash
#!/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"* ]]
|
|
}
|