Skip to content

Commit

Permalink
test: add "runc run --no-pivot must not expose bare /proc"
Browse files Browse the repository at this point in the history
For preventing regression like #2647

Signed-off-by: Akihiro Suda <[email protected]>
Signed-off-by: Aleksa Sarai <[email protected]>
Signed-off-by: Kir Kolyshkin <[email protected]>
  • Loading branch information
AkihiroSuda authored and kolyshkin committed Oct 22, 2020
1 parent 703b7b4 commit 918b7b8
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/integration/no_pivot.bats
Original file line number Diff line number Diff line change
@@ -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"* ]]
}

0 comments on commit 918b7b8

Please sign in to comment.