Skip to content

Commit 6be763e

Browse files
committed
tests: integration: fix capability setting for CAP_DAC_OVERRIDE
Due to the way capabilities have to be set by runc, capabilities need to be included in the inheritable and ambient sets anyway. Otherwise, the container process would not have the correct privileges. This test only functioned because adding CAP_DAC_OVERRIDE to the inherited, permissible, and bounding sets means that only "runc init" has these capabilities -- everything other than the bounding set is cleared on the first execve(). This breaks with runc-dmz, but the behaviour was broken from the outset. Docker appears to not handle this properly at all (the logic for capability sets changed with the introduction of ambient capabilities, and while Docker was updated it seems the behaviour is still incorrect for non-root users). Signed-off-by: Aleksa Sarai <[email protected]>
1 parent b9a4727 commit 6be763e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

tests/integration/start_hello.bats

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ function teardown() {
5858
# Enable CAP_DAC_OVERRIDE.
5959
update_config ' .process.capabilities.bounding += ["CAP_DAC_OVERRIDE"]
6060
| .process.capabilities.effective += ["CAP_DAC_OVERRIDE"]
61+
| .process.capabilities.inheritable += ["CAP_DAC_OVERRIDE"]
62+
| .process.capabilities.ambient += ["CAP_DAC_OVERRIDE"]
6163
| .process.capabilities.permitted += ["CAP_DAC_OVERRIDE"]'
6264

6365
runc run test_busybox

0 commit comments

Comments
 (0)