Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
cmd/snap-confine: re-associate with pid-1 mount namespace if required #2624
Merged
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
64b5c45
Re-associate with pid-1 mount namespace if required
zyga c9c7948
Merge remote-tracking branch 'sc/reassociate-fix' into reassociate-fix
zyga f751c2d
cmd/snap-confine: tweak code layout
zyga 7699614
cmd/snap-confine: don't use O_PATH fd with setns (doh)
zyga c2fd22e
tests: overlay new snap-confine and snap-discard-ns into core snap
zyga 0dc3547
tests: show a tail of kernel log when reassociate test fails
zyga 2c39055
tests: add regression test for LP: #1644439
zyga bac294e
cmd/snap-confine: fix formatting
zyga b2885de
tests: add extra debugging
zyga ed63b5d
tests: tweak reassociate test to use debug kernel
zyga 64d5066
Merge branch 'master' of github.com:snapcore/snapd into reassociate-fix
zyga fcf991f
tests: collect more data about the apparmor/kernel bug
zyga 7525717
tests: fix typo
zyga 3707fa0
tests: collect more debug logs
zyga 52d5268
tests: wrap long line
zyga b00cd51
tests: switch to v2 test kernel
zyga 9695313
tests: fix log file redirection
zyga 82b1d40
Merge branch 'master' of github.com:snapcore/snapd into reassociate-fix
zyga b2c4377
Merge branch 'master' of github.com:snapcore/snapd into reassociate-fix
zyga dcc2fe5
cmd: add missing space
zyga 1bc3b85
tests: use more recent kernel from jj
zyga f0e0188
tests: add FIXME note
zyga 3771236
tests: don't install custom kernel for reassociate fix
zyga b3b2723
tests: fix wording
zyga 0870c41
cmd/snap-confine: document why we reassociate with pid1 ns
zyga 3caa47c
Merge branch 'master' of github.com:snapcore/snapd into reassociate-fix
zyga 61cb05b
Merge branch 'master' of github.com:snapcore/snapd into reassociate-fix
zyga 03da7ae
Merge remote-tracking branch 'upstream/master' into HEAD
mvo5 27f30d5
Merge master.
niemeyer 1ed5c44
cmd/snap-confine: remove redundant getenv
zyga a8d74c5
cmd/snap-confine: tighten ptrace rule (thanks to Tyler Hicks)
zyga 3efbedd
cmd/snap-confine: remove capability sys_ptrace
zyga 7373ee8
Revert "cmd/snap-confine: remove capability sys_ptrace"
zyga 390afad
tests: run 1644439 regression test as user as well
zyga 9074769
tests: display kernel version if 1644439 regression test fails
zyga 384ce39
tests: disable regression test for 1644439 on core systems
zyga c49b78b
Merge branch 'master' of github.com:snapcore/snapd into reassociate-fix
zyga
Jump to file or symbol
Failed to load files and symbols.
| @@ -0,0 +1,30 @@ | ||
| +summary: Regression test for https://bugs.launchpad.net/snap-confine/+bug/1644439 | ||
| +# NOTE: This test is excluded on core systems as the kernel release schedule | ||
| +# there is separate from classic Ubuntu. Once the fixed kernel is available | ||
| +# this line should be removed. | ||
| +systems: [-ubuntu-core-16-*] | ||
| +details: | | ||
| + snap-confine uses privately-shared /run/snapd/ns to store bind-mounted | ||
| + mount namespaces of each snap. In the case that snap-confine is invoked | ||
| + from the mount namespace it typically constructs, the said directory does | ||
| + not contain mount entries for preserved namespaces as those are only | ||
| + visible in the main, outer namespace. In order to operate in such an | ||
| + environment snap-confine must first re-associate its own process with | ||
| + another namespace in which the /run/snapd/ns directory is visible. | ||
| + The most obvious candidate is pid one, which definitely doesn't run in a | ||
| + snap-specific namespace, has a predictable PID and is long lived. | ||
| +prepare: | | ||
| + echo "Having installed the test snap in devmode" | ||
| + . $TESTSLIB/snaps.sh | ||
| + install_local_devmode test-snapd-tools | ||
| +execute: | | ||
| + echo "We can now run a snap command from the namespace of a snap command and see it work" | ||
| + test-snapd-tools.cmd /bin/true | ||
| + test-snapd-tools.cmd /bin/sh -c "SNAP_CONFINE_DEBUG=yes /snap/bin/test-snapd-tools.cmd /bin/true" | ||
| + echo "We can now discard the namespace and repeat the test as a non-root user" | ||
| + /usr/lib/snapd/snap-discard-ns test-snapd-tools | ||
| + su -l -c 'test-snapd-tools.cmd /bin/true' test | ||
| + su -l -c 'test-snapd-tools.cmd /bin/sh -c "SNAP_CONFINE_DEBUG=yes /snap/bin/test-snapd-tools.cmd /bin/true"' test | ||
| +debug: | | ||
| + # Kernel version is an important input in understing failures of this test | ||
| + uname -a |