272 Commits

Author SHA1 Message Date
James Henstridge
277b4f01bc data, packaging: install polkit policy files via data Makefile 2024-07-03 13:38:58 +02:00
Alfonso Sánchez-Beato
1bc4cfdd2b packaging: make sure <state>/snapd/enviroment is created
where it was not the case yet.
2024-05-02 07:47:33 +01:00
ernestl
40efd81c2f release: 2.63 2024-04-24 11:27:52 +02:00
Maciej Borzecki
bae9178245 many: merge release 2.62 (#13749)
* gadget: if storage traits is zero sized file, assume traits do not exist (#13719)

This is a safe fallback, as no-existent storage traits is a valid usecase.

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>

* tests: fix recovery-system-reboot install test that was being interrupted by a system reboot (#13736)

* tests/nested/manual/recovery-system-reboot: fix test that was being interrupted by a system reboot

In the case of an auto-refresh, the system would reboot. This resulted
in some cryptic failures. Make sure to wait for an auto-refresh to
happen before removing the recovery system, and make sure to wait for
the system to reboot once the auto-refresh has finished.

* tests/nested/manual/recovery-system-reboot: add an extra wait to continue waiting after reboot

* sandbox/apparmor: detect but ignore apparmor 4 (#13740)

Due to issues with incorrect behavior to mediate:

    stat /dev/mqueue

For applications governed by the profile that allows it via

    mqueue,

We cannot yet use apparmor 4, even if one is supported on the host. This does
impact userns mediation but it is better to have the old mediation and not
break snaps, than to have some new mediation in some cases and some unexpected
mediation in other cases.

Once the mqueue, issue is identified and we have updated bundled apparmor to a
stable release of apparmor 4, this patch can be reverted.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>

* release: 2.62

* NEWS: restore WIP items

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

---------

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
Co-authored-by: Ondra Kubik <ondrej.kubik@canonical.com>
Co-authored-by: Andrew Phelps <136256549+andrewphelpsj@users.noreply.github.com>
Co-authored-by: Zygmunt Bazyli Krynicki <zygmunt.krynicki@canonical.com>
Co-authored-by: ernestl <ernest.lotter@canonical.com>
2024-03-22 14:45:25 +01:00
Maciej Borzecki
69528a936a interfaces/udev, cmd/snap-confine: support for snaps managing own device cgroups (#13642)
* dirs: add directory location for storing cgroup policy related flags

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* interfaces/udev: introduce cgroup policy flag for self managed device cgroup

Some snaps, due to their interfaces, are allowed to self manage the device
cgroup. In this case, the assumption was to not emit any rules at all, and
instead rely on the implicit behavior that no rules means no matching devices
and hence no device cgroup filtering. However, with introduction of a device
cgroup by default for all snaps on core24 onward, regardless of any assigned
devices, we need a separate source of information to indicate that a snap can do
self management.

The patch introduces a policy flags under /var/lib/snapd/cgroup, named
snap.<name>.device, eg.
/var/lib/snapd/cgroup/snap.docker.device, which provides a hints for
snap-confine to not set up a device cgroup filtering for apps.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* cmd/snap-confine: support snaps which self-manage device cgroup

Support for snaps for which policy explicitly states that the device cgroup is
self-managed. The typical use case is container like technologies. In such
scenario, there will be a device cgroup configuration file at a known location
which got generated by snapd whenever the relevant interface state changed.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* tests/main/security-device-cgroups-self-manage: spread test

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* cmd/snap-confine: drop base from bases exempt from mandatory device cgroup

We have confirmed that there are no snaps which (ab)use system files and use
bare base to obtain access to devices. As such, the bare base can be dropped
form the list of bases exempt from mandatory device cgroup.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* interfaces/udev: remove snap devices file when removing the snap

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* interfaces/udev: consistent use of fs.ErrNotExist

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* cmd/snap-confine: leave comments

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* interfaces/udev: tweak return path

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* interfaces/udev: improve managed device cgroup unit tests, verify calls to udevadm

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* NEWS: leave a note about mandatory device cgroup

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* tests/main/security-device-cgroups-self-manage: tweak comments

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* interfaces/udev: always write the device file

Always write the device file which serves as a synchronization point between
snap-confine and the snapd udev backend.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* cmd/libsnap-confine-private: add helper for waiting for a file to show up

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* cmd/snap-confine: make cgroup device file mandatory

Make the per-snap /var/lib/snapd/cgroup/snap.*.device file mandatory, such that
it can be used as a synchronization point between snapd calling Setup() of
relevant security backends and the execution path in snap-confine.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* cmd/snap-mgmt: do cleanup of /var/lib/snapd/cgroup

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* packaging: declare /var/lib/snapd/cgroup

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* cmd/snap-confine: use the file wait helper

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* packaging: create cgroup directory

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* tests/main/security-device-cgroups-self-manage: update file check

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* tests/main/security-device-cgroups-required-or-optional: update test to verify device file

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* interfaces/udev: refactor reloading

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

* cmd/snap-confine: move device cgroup mode selection to a helper

Extract device cgroup mode selection into a helper function.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>

---------

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
2024-03-07 13:23:58 +01:00
ernestl
4194045021 release: 2.61.3 2024-03-07 10:54:29 +02:00
ernestl
82fe7c4ad0 release: 2.61.2 2024-02-19 08:49:11 +01:00
Oliver Calder
b3a4a16118 packaging/opensuse: remove prompting service files
This reverts most of the changes from the following:

commit 68069967eb

    packaging/opensuse: sync with openSUSE packaging

    Sync with downstream packaging in openSUSE

Signed-off-by: Oliver Calder <oliver.calder@canonical.com>
2024-02-08 09:30:18 +01:00
Ernest Lotter
437aa8d829 release: 2.61.1 (#13394)
cherry picked more changes for 2.61.1

release: 2.61.1
2023-11-29 12:06:36 +02:00
Philip Meulengracht
03feab5aa4 release: 2.61 (#13299)
release: 2.61
2023-10-13 13:53:06 +02:00
Michael Vogt
a66b7d06a8 release: 2.60.4 (#13200) 2023-09-16 09:18:23 +02:00
Valentin David
3bf4f7c206 cmd/configure.ac: use AX_APPEND_COMPILE_FLAGS 2023-08-29 17:50:35 +02:00
Michael Vogt
cd9d5dc108 release: 2.60.3 (#13124) 2023-08-25 19:48:46 +02:00
Michael Vogt
a29410f4f0 release: 2.60.2 (#13063) 2023-08-23 11:39:34 +02:00
Michael Vogt
7af3db6707 release: 2.60.1 (#12950) 2023-07-06 09:51:32 +02:00
Michael Vogt
2aa5e01d66 release: 2.60 (#12894) 2023-06-15 18:10:58 +02:00
Michael Vogt
223c032d80 release: 2.59.5 2023-05-27 10:13:24 +02:00
Michael Vogt
3eb99f8b71 release: 2.59.4 2023-05-12 12:15:37 +02:00
Michael Vogt
89c13227ca release: 2.59.3 (#12792) 2023-05-12 12:15:22 +02:00
Michael Vogt
754fb2dc4c release: 2.59.2 2023-04-18 21:04:09 +02:00
Michael Vogt
66af06e466 packaging: update for go-1.18 2023-04-17 15:48:36 +02:00
Michael Vogt
66f919669a release: 2.59.1 2023-03-29 11:14:48 +02:00
Michael Vogt
0cdbff75a8 release: 2.59 2023-03-10 14:49:10 +01:00
Michael Vogt
f534a04de0 release: 2.58.3 (#12581) 2023-02-22 15:51:33 +01:00
Michael Vogt
ca8ce9ff42 releasing package snapd version 2.58.2 (#12522) 2023-01-26 09:01:48 +01:00