[PATCH 2/4] many: Use /tmp/snap-private-tmp for per-snap private tmps
authorAlex Murray <alex.murray@canonical.com>
Mon, 19 Sep 2022 04:20:36 +0000 (13:50 +0930)
committerAlex Murray <alex.murray@canonical.com>
Mon, 28 Nov 2022 10:37:00 +0000 (10:37 +0000)
commitf73b7f92e8cf5b93ab52760be43b2d3245c8807e
treed49c0d60130c9779705945f934e63f4f37bb493e
parent323c8e410b1c77cfcb1b01a3235bb079ad2b7a76
[PATCH 2/4] many: Use /tmp/snap-private-tmp for per-snap private tmps

Backport of the following upstream patch:
From fe2d2d8471665482628813934d9f19e8ca5e4a1f Mon Sep 17 00:00:00 2001

Backport of the following upstream patch:
From fe2d2d8471665482628813934d9f19e8ca5e4a1f Mon Sep 17 00:00:00 2001
From: Alex Murray <alex.murray@canonical.com>
Date: Mon, 19 Sep 2022 13:50:36 +0930
Subject: [PATCH 2/4] many: Use /tmp/snap-private-tmp for per-snap private tmps

To avoid unprivileged users being able to interfere with the creation of the
private snap mount namespace, instead of creating this as /tmp/snap.$SNAP_NAME/
we can now use the systemd-tmpfiles configuration to do this for us
at boot with a known fixed name (/tmp/snap-private-tmp/) and then use that as
the base dir for creating per-snap private tmp mount
namespaces (eg. /tmp/snap-private-tmp/snap.$SNAP_INSTANCE/tmp) etc.

Signed-off-by: Alex Murray <alex.murray@canonical.com>
Gbp-Pq: Name 0018-cve-2022-3328-2.patch
13 files changed:
cmd/snap-confine/mount-support-test.c
cmd/snap-confine/mount-support.c
cmd/snap-confine/snap-confine.apparmor.in
cmd/snap-update-ns/system.go
cmd/snap-update-ns/system_test.go
interfaces/builtin/x11.go
interfaces/builtin/x11_test.go
tests/lib/reset.sh
tests/main/cgroup-tracking/task.yaml
tests/main/interfaces-x11-unix-socket/task.yaml
tests/main/security-private-tmp/task.yaml
tests/main/snap-confine-tmp-mount/task.yaml
tests/main/snap-confine-undesired-mode-group/task.yaml