52331 Commits

Author SHA1 Message Date
Ian Johnson
aa0c4db8d8 release: 2.53.2
Update changelogs with the 2.53.2 changes.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2.53.2
2021-11-15 17:49:32 -06:00
Hsieh-Tseng Shen
edbca85967 interfaces/builtin/block_devices: allow blkid to print block device attributes
To allow blkid to visit block_devices attributes via low level probing, so that
we can get information like partition table type or PART_ENTRY_UUID
which could be useful for script based snap without parsing
/run/udev/data/b{major}:{minor}.

Signed-off-by: Hsieh-Tseng Shen <woodrow.shen@canonical.com>
2021-11-15 21:07:14 +01:00
Maciej Borzecki
a37f10c9a1 cmd/libsnap-confine-private: do not deny all devices when reusing the device cgroup
* cmd/libsnap-confine-private: do not deny all devices when reusing the device cgroup

With device cgroup v1, when reusing the cgroup (i.e. opening with
SC_DEVICE_CGROUP_FROM_EXISTING flag), we should not deny all devices, as this
will negatively affect the processes that are in the group.

This code path was executed by snap-device-helper, so it is possible that when
processing of real events from device changes the group could have become
broken.

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

* cmd/libsnap-confine-private/device-cgroup-support.c: add comment

Co-authored-by: Ian Johnson <person.uwsome@gmail.com>

* tests/main/security-device-cgroups-strict-enforced: verify that udev changes do not break device group settings

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

* tests/main/security-device-cgroups-strict-enforced: skip triggering events on 14.04

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

Co-authored-by: Alberto Mardegan <mardy@users.sourceforge.net>
Co-authored-by: Ian Johnson <person.uwsome@gmail.com>
2021-11-15 15:57:24 +01:00
Ondrej
460790f327 interfaces/builtin/time-control: allow pps access
* interfaces/builtin/time-control: allow pps access

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

* interfaces/builtin/time-control: fix go formatting

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

* interfaces/builtin/time-control: fix failing tests after adding pps support

Signed-off-by: Ondrej Kubik <ondrej.kubik@canonical.com>
2021-11-15 15:56:20 +01:00
Olivier
a570217061 interfaces/u2f-devices: add Trezor and Trezor v2 keys
* interfaces/u2f-devices: add Trezor and Trezor v2 keys (https://launchpad.net/bugs/1947746)

* Add another product ID to the valid patterns.

Co-authored-by: Michael Vogt <mvo@ubuntu.com>
2021-11-15 14:02:37 +01:00
Oliver Grawert
1a30861c58 interfaces: timezone-control, add permission for ListTimezones DBus call
Amend mail address to fix cla-check issues
2021-11-15 11:53:42 +01:00
Ian Johnson
e1d8326c81 interfaces/apparmor/template.go: allow udevadm from merged usr systems
Such as the core20 and newer base snaps for example.

Thanks to @xnox for finding this issue.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-11-12 10:38:33 +01:00
Alfonso Sánchez-Beato
35b76d9055 interface/modem-manager: allow connecting to the mbim/qmi proxy
Add permissions to the connected slot so MM can actually talk to
incoming connections to mbim/qmi proxies. Remove "accept" from the
permanent slot, as it is not actually the right place for it.
2021-11-09 15:18:19 +01:00
Alex Murray
397efc83ff interfaces/network-manager-observe: Update for libnm client library
The official libnm client library uses the
ObjectManager.GetManagedObjects() DBus interface method to query properties
from NetworkManager, as well as using the InterfacesAdded /
InterfacesRemoved signals, so update this interface to provide access to
that, plus ensure they can also receive the PropertiesChanged signal from
NetworkManager objects as well as this is also required.

This change should also allow Dart applications which use the nm.dart library to
get interface addresses etc without requiring to use the more privileged
network-manager interface, as this library is similar to libnm:

https://forum.snapcraft.io/t/request-auto-connect-network-manager-for-cybear-jinni-app-again/26520
2021-11-08 20:00:36 +01:00
Maciej Borzecki
008d644e08 cmd/snap-seccomp/syscalls: update syscalls to match libseccomp abad8a8f4
Update the list of syscalls, to match the latest libseccomp commit:
abad8a8f41

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-11-08 19:25:09 +01:00
Maciej Borzecki
71d6173daa sandbox/cgroup: freeze and thaw cgroups related to services and scopes only
When freezing and thawing cgroups related to a snap, the code would incorrectly
try to operate on cgroups related to mounts, socket, slices if they had the
snap.<name>.<app> prefix.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-11-04 13:46:55 +01:00
Pawel Stolowski
a2a837c81e o/hookstate: print cohort with snapctl refresh --pending (#10985)
Print cohort key with snapctl refresh --pending as long as snap-refresh-control interface is connected.
2021-11-04 12:07:08 +01:00
Michael Vogt
7c20a83a0c Merge pull request #10999 from mvo5/snap-confine-cgroup-only-devices-were-assigned-2.53
cmd/snap-confine: lazy set up of device cgroup, only when devices were assigned (2.53)
2021-11-03 09:02:42 +01:00
Maciej Borzecki
01148080ec cmd/snap-confine: tiny refactor, tweak comments
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-11-02 18:07:47 +01:00
Maciej Borzecki
fabd916136 tests/main/security-dev-input-event-denied: fix the test
Now that device cgroup assignment when no devices match is done properly, i.e.
we do not end up in a cgroup with just the common set of devices if none are
assigned, the test needs to be updated as we correctly observe first the
AppArmor denial, and then a device cgroup one.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-11-02 18:07:47 +01:00
Maciej Borzecki
e64200b6d8 cmd/snap-confine: fix formatting of current tag setup
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-11-02 18:07:47 +01:00
Maciej Borzecki
32cf4cea59 cmd/snap-confine: lazy set up of device cgroup, only when devices were assigned
Historically, a snap process ended up in a device cgroup (with device filtering)
only when there were assigned devices for it. On systems where CURRENT_TAGS is
supported and set by systemd/udev, snap-confine needs to do 2 passes on the list
of assigned devices. It may happen, that despite snap tag being present in the
TAGS list, it will not be present in the CURRENT_TAGS, in which case we may end
up in a scenario when no devices are actually assigned to the snap. The current
code would incorrectly handle such situation, and move the process into device
cgroup.

The branch introduces a lazy initialization of device cgroup and moves the
process to the group (or sets up device filtering on v2) only when there were
any assigned device.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-11-02 18:07:47 +01:00
Maciej Borzecki
337c6db7ad tests: ensure systemd-timesyncd is installed on debian
Required by interfaces-timeserver-control test.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-11-02 18:06:22 +01:00
Maciej Borzecki
1d8c150b9b tests/lib/pkgdb: install strace on Debian 11 and Sid
Strace provided by strace-static is too old and segfaults on Sid.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-11-02 18:05:59 +01:00
Alberto Mardegan
01286bd0c5 tests/main/snapd-sigterm: flush, use retry 2021-11-02 18:05:46 +01:00
Alberto Mardegan
a3f7a9544e tests/main/snapd-sigterm: fix race conditions
There are a few issues with the current test:

- the previous attempt to fix the failures (adding the `-q` option to
  nc) did not help, because the `-q` option only adds a wait before
  exiting the program, and does not delay the closing of the socket.

- the reason why the snapd service was being restarted is that spawning
  the client in the background (`&`) does not guarantee that the client
  has completed (or even initiated) its request to snapd before we stop
  the service.

Here we fix both issues by:

1. Replace nc with a python script that does perform a sleep() *before*
   closing the socket.
2. Use a sentinel file to understand when the client request to snapd
   has completed and the socket is idle.
2021-11-02 18:05:41 +01:00
Ian Johnson
e8cb14194e release-tools/repack-debian-tarball.sh: fix c-vendor dir
This needs to be absolute to the extracted dir.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-11-02 18:05:16 +01:00
Maciej Borzecki
37f39d55c0 data/selinux: allow snap-confine to read udev's database
These denials occasionally pop up when snap-confine starts inspecting assigned
devices:

----
type=AVC msg=audit(10/28/21 06:54:05.000:11501) : avc:  denied  { read } for  pid=56565 comm=snap-confine name=c1:7 dev="tmpfs" ino=17684 scontext=system_u:system_r:snappy_confine_t:s0 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=1
----
type=AVC msg=audit(10/28/21 06:54:05.000:11502) : avc:  denied  { open } for  pid=56565 comm=snap-confine path=/run/udev/data/c1:7 dev="tmpfs" ino=17684 scontext=system_u:system_r:snappy_confine_t:s0 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=1
----
type=AVC msg=audit(10/28/21 06:54:05.000:11503) : avc:  denied  { getattr } for  pid=56565 comm=snap-confine path=/run/udev/data/c1:7 dev="tmpfs" ino=17684 scontext=system_u:system_r:snappy_confine_t:s0 tcontext=system_u:object_r:udev_var_run_t:s0 tclass=file permissive=1
-----

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-11-02 18:04:29 +01:00
Ian Johnson
7280bdc64a interfaces/dsp: add more ambarella things
* interfaces/dsp: add more ambarella things

As per customer ticket 00321783.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>

* interfaces/builtin/dsp_test.go: adjust tests too

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-11-02 18:02:22 +01:00
Ian Johnson
cb29ff949f release: 2.53.1
Update changelogs with the 2.53.1 changes.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2.53.1
2021-10-21 14:10:37 -05:00