52331 Commits

Author SHA1 Message Date
Maciej Borzecki dfe3219f5e tests/main/cwd: try su -l
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-19 11:16:07 +02:00
Maciej Borzecki 68ea246cf4 tests/main: actually use tests.session for executing things as a user
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-19 11:16:07 +02:00
Maciej Borzecki ea0f692284 tests/main: disable tests that require user session on ubuntu-14.04
Since this requires a more recent systemd

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-19 11:16:07 +02:00
Maciej Borzecki dea90b4161 spread: echo before listing bpf maps
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-19 11:16:07 +02:00
Maciej Borzecki f934972c8a cmd/libsnap-confine-private: use a buffer on stack, rather than a malloc'ed one
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-19 11:16:07 +02:00
Maciej Borzecki 1f19fade0b tests/main: move more tests to the tests.session helper
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-19 11:16:07 +02:00
Maciej Borzecki b2fa762fbf tests/main/parallel-install-basic: start test user session before su
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-19 11:16:07 +02:00
Maciej Borzecki b8dd421253 tests/main/security-private-tmp: prepare test user session
This seems to be enough to have the session bus and systemd up

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-19 11:16:07 +02:00
Maciej Borzecki 73fdf8a04a tests/main/snapshot-users: port the test to tests.session helper
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-19 11:16:07 +02:00
Maciej Borzecki 6517ab8063 tests/main/snap-confine-privs: fix the test to use tests.session helper
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-19 11:16:07 +02:00
Maciej Borzecki 8b8b44555d spread: when tests fail, list any present cgroup v2 device filter maps
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-19 11:16:07 +02:00
Maciej Borzecki c284962023 cmd/libsnap-confine-private: require snap specific cgroup before setting up device control on v2
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-19 11:16:07 +02:00
Maciej Borzecki 9653dda33e tests/main/snap-confine-undesired-mode-group: use tests.session helper
Such that the snap application which apparently has matching devices will
execute with proper tracking enabled.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-19 11:16:07 +02:00
Maciej Borzecki fea19b3261 cmd/libsnap-confine-private: cgrupv2 die when process is not in snap specific group
It is possible that the snap process has not been moved to the snap specific
tracking cgroup. In this case, setting up a device filtering on the group can
negatively affect whatever group the process is part of. Try to catch test
scenarios when thiss happens, so that we may reach a reasonable solution.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-19 11:16:07 +02:00
Maciej Borzecki 02651c9628 cmd/snap-confine: drop misplaced comment
Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-19 11:16:07 +02:00
Tao Wang 9a229e4052 Add '/com/canonical/dbusmenu' path access to 'unit7' interface
Allow the path in unity7 inteface will fix systray issue in some applications.

Signed-off-by: Tao Wang <twang2218@gmail.com>
2021-10-18 12:56:41 -05:00
Alberto Mardegan 7d2aff822d tests: add a regression test for snapd hanging on SIGTERM 2021-10-18 12:56:19 -05:00
Alberto Mardegan da1caa8b12 daemon: use the syscall connection to get the socket credentials
For some reason, the old code was causing snapd to hang when asked to
terminate if there were still some clients connected: the connection
would not move to the "idle" state.

This was found while investigating LP#1946656, and as a matter of facts
it fixes it. While debugging, an inspection of snapd threads while in
hanging state revealed that one thread was stuck in

    daemon.(*ucrednetConn).Read

and it was verified that removing the Accept function completely would
resolve the issue (though also considerably changing snapd behaviour).

The problem with the old code does not lie in duplicating the file
descriptor (which is done by calling UnixConn.File()), but rather in the
apparently innocuous call to File.Fd(): as it can be seen by looking at
its source code[^note1], this function sets the file descriptor mode to
blocking, and this is what causes our connections to hang.

[^note1]: https://cs.opensource.google/go/go/+/refs/tags/go1.17.2:src/os/file_unix.go;l=81-88
2021-10-18 12:56:16 -05:00
Ian Johnson cea4609c8c interfaces/builtin/hardware-observer: add /proc/bus/input/devices too
This is needed for a customer request, see ticket 00320804 for full details.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-10-18 12:55:26 -05:00
Ian Johnson 0ea5001e75 cmd/snap-confine/snap-confine.apparmor.in: update ld rule for s390x impish
Observed on an Impish s390x machine:

root@test-i:~# ls -lah /usr/lib/ld64.so.1
lrwxrwxrwx 1 root root 25 Sep  2 21:26 /usr/lib/ld64.so.1 -> s390x-linux-gnu/ld64.so.1

Which comes from the new libc6, and is different from what we expected on
previous releases, see for example Hirsute:

root@testing-h:~# ls -lah /usr/lib/ld64.so.1
lrwxrwxrwx 1 root root 26 Mar 31  2021 /usr/lib/ld64.so.1 -> s390x-linux-gnu/ld-2.33.so

The latter matched the existing rule, while the former does not. The new rule
allows both.

Signed-off-by: Ian Johnson <ian.johnson@canonical.com>
2021-10-18 12:53:38 -05:00
Samuele Pedroni 9adc29b323 interface/modem-manager: add accept for MBIM/QMI proxy clients
Merge pull request #10931 from alfonsosanchezbeato/add-accept-mm

We need accept too for clients to connect.
2021-10-18 12:46:43 -05:00
Samuele Pedroni a30c4abe8d secboot: revert move to new version (revert #10715)
Merge pull request #10930 from anonymouse64/revert-10715-bump-secboot

Reverts #10715

Sadly the new version of secboot seems to auto-upgrade v1 keys to v2, which old recovery systems and even the currently published initrds/kernels do not understand so they fail to unlock the encrypted partitions in the initrd.

This PR includes #10929 which adds the following tests:
* test from stable snapd + stable kernel refreshing to snapd from the PR
* test from stable kernel + snapd from the PR

and for each variant then do something which triggers a reseal operation and a reboot to ensure that the new snapd will not break old recovery system kernels
2021-10-18 11:49:18 -05:00
Michael Vogt 63c82c0ab1 release: 2.53 (really this time after cherry-picking d07bfcd) 2.53 2021-10-05 20:32:32 +02:00
Maciej Borzecki d07bfcd9ad overlord: fix generated snap-revision assertions in remodel unit tests
When building on LP, the mock snap files generated with mksquashfs end up having
the same sha3-348 digest, despite forcing a 1s delay between consecutive snap
builds, what should have affected the internal file timestamps. As a workaround,
use a different content of mock files, such that the files must yield a
different digest.

Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>
2021-10-05 20:28:53 +02:00
Michael Vogt 3546f33f73 release: 2.53
Update changelogs with the 2.53 changes.
2021-10-05 19:59:28 +02:00