snappy:release/2.52

Last commit made on 2021-10-05
Get this branch:
git clone -b release/2.52 https://git.launchpad.net/snappy

Branch merges

Branch information

Name:
release/2.52
Repository:
lp:snappy

Recent commits

cd99de5... by Michael Vogt

release: 2.52.1 (#10885)

Update changelog with the 2.52.1 changes.

8324469... by Michael Vogt

snap-bootstrap: wait in `mountNonDataPartitionMatchingKernelDisk`

* snap-bootstrap: wait in `mountNonDataPartitionMatchingKernelDisk`

The current snap-bootstrap has a race when mounting the seed
partition in `mountNonDataPartitionMatchingKernelDisk` on EFI
systems.

The code determines the partUUID of the disk that booted the
kernel by reading the EFI LoaderDevicePartUUID variable. However
there is no guarantee that this partition is available when
snap-bootstrap runs, the kernel may still enumerate the HW.
This can be observed on a fast NUC when booting from a USB
stick.

Note that the `the-tool.serice` already has a
"After=systemd-udev-settle.service" set but that is still
racy because any `udev settle` (or `udev trigger --settle`)
is racy, the only option is to poll for the part uuid to
appear.

This is a minimal commit to avoid too much churn in code.

Thanks to Sertac for reporting this bug.

* snap-bootstrap: rework waitPartSrc to improve testing (thanks to Alberto and Ian)

* snap-bootstrap: show a log message if waitPartSrc needs to wait

If waitPartSrc needs to wait for the device this commit makes it
show a logger.Noticef() message. The message is only shown once
because waiting for the device is usually super quick and if it
is not that is most likely an error anyway so spamming the
terminal will not help.

* snap-bootstrap: add test that ensures that if no waiting is needed for partSrc no log message is displayed

* snap-bootstrap: rename waitPartSrc -> waitFile

* snap-bootstrap: fix time.Duration() casting on 32bit systems

f2b1862... by Michael Vogt

Merge pull request #10877 from mvo5/system-restart-immediate-2.52

many: support an API flag system-restart-immediate to make snap ops proceed immediately with system restarts (2.52)

c0c2296... by Michael Vogt

daemon: update to support 2.52

741b482... by Samuele Pedroni

many: support an API flag system-restart-immediate to make snap ops proceed immediately with system restarts (#10871)

* daemon: introduce system-restart-immediate flag in the snaps APIs

this gets reflected on the Change

* overlord: make Changes respect system-restart-immediate

have all system restart requests that don't use Now already
use snapstate.RestartSystem which consults system-restrat-immediate
on the Change as set by daemon

81664ee... by Maciej Borzecki

cmd/libsnap-confine-private: g_spawn_check_exit_status is deprecated since glib 2.69

With https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1967 the
g_spawn_check_exit_status call is flagged as deprecated now. This also broke in
F35 mass rebuild in Rawhide:

make[1]: Leaving directory '/builddir/build/BUILD/snapd-2.51/cmd'
libsnap-confine-private/test-utils.c: In function 'rm_rf_tmp':
libsnap-confine-private/test-utils.c:63:9: error: 'g_spawn_check_exit_status' is deprecated: Use 'g_spawn_check_wait_status' instead [-Werror=deprecated-declarations]
   63 | g_assert_true(g_spawn_check_exit_status(exit_status, NULL));
      | ^~~~~~~~~~~~~
In file included from /usr/include/glib-2.0/glib.h:81,
                 from libsnap-confine-private/test-utils.c:24:
/usr/include/glib-2.0/glib/gspawn.h:280:10: note: declared here
  280 | gboolean g_spawn_check_exit_status (gint wait_status,
      | ^~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
make[1]: *** [Makefile:2705: libsnap-confine-private/libsnap_confine_private_unit_tests-test-utils.o] Error 1
make[1]: *** Waiting for unfinished jobs....

Signed-off-by: Maciej Borzecki <email address hidden>

6c0c6cf... by Maciej Borzecki

interfaces/seccomp: add clone3 to default template

Recent combinations of Go 1.17, glibc 2.34 and Linux 5.14 ended up triggering
pthread_create() code paths that try to use clone3() syscall when executing
snap-exec. Since snap-exec runs under the seccomp profile of the application,
make sure that clone3 is allowed in the default template. Also, applications may
trigger this code path themselves anyway.

The strace output when this fails looks like this:

mprotect(0x7f4ad3ea2000, 8388608, PROT_READ|PROT_WRITE) = 0
rt_sigprocmask(SIG_BLOCK, ~[], ~[KILL STOP RTMIN RT_1], 8) = 0
syscall_435(0x7ffc466b4c60, 0x58, 0x58b300, 0x8, 0x7f4ad46a1640, 0x7ffc466b4d4f) = -1 (errno 1)
rt_sigprocmask(SIG_SETMASK, ~[KILL STOP RTMIN RT_1], NULL, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
write(2, "runtime/cgo: ", 13runtime/cgo: ) = 13
write(2, "pthread_create failed: Operation not permitted", 46pthread_create
failed: Operation not permitted) = 46

Where syscall 435 is also known as clone3:

$ scmp_sys_resolver 435
clone3

Signed-off-by: Maciej Borzecki <email address hidden>

2acabba... by Sergio Cazzolato

Skip system-usernames-microk8s when TRUST_TEST_KEYS is false

This test is failing on uc20 for beta validation because the execution
is done even when TRUST_TEST_KEYS is false

e4f16de... by Ian Johnson

interfaces/apparmor/template.go: allow inspection of dbus mediation level

This does not leak any information since an app could always try to send dbus
messages and see what fails to perform the same inspection, but this helps
eliminate some messages when using i.e. dbus-run-session legitimately for some
applications.

See also the thread on https://forum.snapcraft.io/t/how-to-use-dbus-run-session-on-ubuntu-core/7077/3

Signed-off-by: Ian Johnson <email address hidden>

fcab702... by Ian Johnson

interfaces/dsp: add a usb rule to the ambarella flavor

This is needed as per a recent customer ticket, see SF ticket #00319598 for
more details.

Signed-off-by: Ian Johnson <email address hidden>