Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release: 2.68.2 #15141

Merged
merged 43 commits into from
Feb 28, 2025
Merged

release: 2.68.2 #15141

merged 43 commits into from
Feb 28, 2025

Conversation

ernestl
Copy link
Collaborator

@ernestl ernestl commented Feb 26, 2025

Generated changelogs with:
DEBEMAIL="Ernest Lotter [email protected]" release-tools/changelog.py 2.68.2 2098137 NEWS.md

Cherry-picks:

Functional improvements:

Tests improvements:

SRU Bug: https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/2098137
Jira: https://warthogs.atlassian.net/browse/SNAPDENG-34578

Requires rebase merge

valentindavid and others added 16 commits February 26, 2025 22:39
* secboot,overlord/fdestate: seal with boot mode for FDE hooks

Set the authorized boot modes for FDE hook keys. For now
the run+recover key allows "run" and "recover", while
the recover key allows "recover" and "factory-reset".

* overlord/fdestate/backend: split profiles for data and save partitions

There should be 3 different keys for FDE hooks. The run+recover key
should be allowed for boot modes "run" and "recover". While recover
key on data disk should be allowed on "recover". And finally recovery
on save disk should be allowed in "recover" and "factory-reset". Here
we split the profiles for "recover" for disks "data" and "save", so
that we can set different authorized boot modes.

* fixup! overlord/fdestate/backend: split profiles for data and save partitions
…15068)

* Add more kernel fusion driver files

* Fix permissions for kfd uevent read-only file
* secboot: add argon2 out-of-process command helpers

Signed-off-by: Zeyad Gouda <[email protected]>

* cmd/{snapd,snap-bootstrap}: add argon2 out-of-process special mode sub-commands

Signed-off-by: Zeyad Gouda <[email protected]>

* Revert "secboot: default to pbkdf2 instead of argon2id (canonical#15058)"

This reverts commit ec60555.

* fixup! secboot: use --argon2-proc arg instead of run-argon2 sub-command

Signed-off-by: Zeyad Gouda <[email protected]>

* fixup! secboot: handle error directly in MaybeRunArgon2OutOfProcessRequestHandler

Signed-off-by: Zeyad Gouda <[email protected]>

* fixup! secboot: disable argon2 out-of-process tests when built with nosecboot

Signed-off-by: Zeyad Gouda <[email protected]>

* fixup! secboot: set argon2 kdf from MaybeRunArgon2OutOfProcessRequestHandler

Signed-off-by: Zeyad Gouda <[email protected]>

* fixup! secboot: allow passing matching args for argon2 special mode

Signed-off-by: Zeyad Gouda <[email protected]>

* fixup! secboot: address review comments

Signed-off-by: Zeyad Gouda <[email protected]>

---------

Signed-off-by: Zeyad Gouda <[email protected]>
)

* image, seed: check snap-bootstrap compatibility for FDE

Snapd 2.68 or later is not compatible in the same seed as
snap-boostrap 2.67 or before. We need to make it a bit more obvious to
image builders by forbidding that combination.

* image,seed: tweak error message, fail on snap-bootstrap issue and allow controlling the behaviour of the erroring out with a cli switch and environmental variable (for easier testing in spread)

---------

Co-authored-by: Philip Meulengracht <[email protected]>
…anonical#15116)

* boot: drive-by: fix typo in isModeenvLocked

* boot: have a separate mutex for the sections writing a fresh modeenv

when we write a fresh modeenv and seal we are operating on the modeenv
of not the current system, so it was wrong to use the same mutext

this now mostly avoid overlapping operations of this kind, which shouldn't
happen, but is the most conservative change

we need to rethink the modeenv mutexes as naively releasing the
state lock while holding them can create deadlocks when we try
to reacquire the former
The posix-mq interface was merged a while ago without any dedicated tests.
Historically there were a number of issues around mediation of mqueue and
having this sort of test provided earlier might have saved us some time later.

The test verifies runtime correctness of the read, write, create and delete
permissions specific to the posix-mq interface, using the test-snapd-posix-mq
snap. The snap has been issued with a snap declaration assertion to use the
posix-mq interface slots, which are super-privileged. All slots grant access to
the /test POSIX message queue, with the relevant permission, read, write,
create or delete.

The tests is skipped on Ubuntu Core 18 and earlier, and equivalent, due to a
bug (referenced). Technically the interface apparmor elements require
apparmor_parser version 4.0.1 or newer present in snapd snap. The interface
does not work with host-provided apparmor as snapd explicitly constrains it to
ABI 3.0 which does not support mqueue.

In addition also remove posix-mq plug of test-snapd-policy-app-consumer as that
is required by static checker:

  Dedicated test 'tests/main/interfaces-posix-mq' found for 'posix-mq'.
  Please remove 'posix-mq' from 'tests/lib/snaps/test-snapd-policy-app-consumer/meta/snap.yaml'.

Signed-off-by: Zygmunt Krynicki <[email protected]>
* go.mod: bump secboot to rev e07f4ae48e98

Bump secboot to include a fix from
canonical/secboot#384

Signed-off-by: Maciej Borzecki <[email protected]>

* secboot: update to match canonical/secboot API changes

Signed-off-by: Maciej Borzecki <[email protected]>

---------

Signed-off-by: Maciej Borzecki <[email protected]>
* confdb: support pruning ephemeral data

This introduces a PruneEphemeral function to schemas that takes raw data
and removes paths that the schema has marked as ephemeral.

Signed-off-by: Miguel Pires <[email protected]>

* confdb: fix pruning of alternatives

Signed-off-by: Miguel Pires <[email protected]>

* confdb: extend doc

Signed-off-by: Miguel Pires <[email protected]>

---------

Signed-off-by: Miguel Pires <[email protected]>
Allow alternatives to mix ephemeral and non-ephemeral types and process
each type in order, taking the first matching alternative's ephemeral
tag in consideration when pruning.

Signed-off-by: Miguel Pires <[email protected]>
We want to be more precise when controlling the posix-mq interface. Since the
apparmor side implements both posix and sysv mediation we want to be extra
careful about using the type qualifier correctly in the posix-mqueue interface.
At present that is bound to generic mqueue rule. With this type-aware probe we
should be able to switch that to POSIX-only.

Signed-off-by: Zygmunt Krynicki <[email protected]>
The interface was emitting apparmor mqueue rules that allow both posix and sysv
message queues. It was always the documented intent to allow posix message
queues only. Change the verified apparmor feature to our self-named
mqueue-posix.

Signed-off-by: Zygmunt Krynicki <[email protected]>
It was possible to have snapd extend the posixMQDefaultPlugPerms, []string
value that was meant to be constant, to contain the "open" permission.

A plug connected to a slot without explicit permissions is granted
the default permissions but then any set of permissions without the
open permission is extended, by appending to the slice, to ensure that
open is always allowed.

This might allow an attacker to trick snapd into granting the open
permission incorrectly.

Signed-off-by: Zygmunt Krynicki <[email protected]>
Those attributes mediate ability to access data exposed and manipulated by
mq_getsetattr system call - the configuration of the queue as well as the
non-blocking flag.

Historically those were implicitly granted by the kernel, as a consequence of
the file access rules (mqueue is present in both file and policy DFAs) but with
the introduction of separate getattr/setattr mediation patches this is no
longer the case.

Presence of read auto-grants getattr, the same is done for setattr and write.
This is to ensure continuity should the kernel change behavior and require
providing those permissions explicitly.

Note that slots which grant all the permissions possible, are now also
permission-extended to include attribute permissions.

Signed-off-by: Zygmunt Krynicki <[email protected]>
@ernestl ernestl added Needs Samuele review Needs a review from Samuele before it can land Run nested The PR also runs tests inluded in nested suite labels Feb 26, 2025
@ernestl ernestl added this to the 2.68.2 milestone Feb 26, 2025
Copy link

github-actions bot commented Feb 26, 2025

Thu Feb 27 01:26:40 UTC 2025
The following results are from: https://github.com/canonical/snapd/actions/runs/13555179275

Failures:

Preparing:

  • google-nested:ubuntu-24.04-64:tests/nested/manual/hybrid-remodel

Executing:

  • google-nested:ubuntu-22.04-64:tests/nested/manual/muinstaller-real:encrypted
  • google-nested:ubuntu-22.04-64:tests/nested/manual/muinstaller-real:seeded
  • google-nested:ubuntu-22.04-64:tests/nested/manual/muinstaller-real:plain
  • google-nested:ubuntu-22.04-64:tests/nested/manual/muinstaller-real:partial
  • google-nested:ubuntu-24.04-64:tests/nested/manual/core20-remodel
  • google-nested:ubuntu-24.04-64:tests/nested/core/core20-fault-inject-on-refresh:base_reboot_link_snap
  • google-nested:ubuntu-24.04-64:tests/nested/core/core20-reinstall-partitions
  • google-nested:ubuntu-24.04-64:tests/nested/manual/muinstaller-real:plain
  • google-nested:ubuntu-24.04-64:tests/nested/manual/muinstaller-core:plain
  • google-nested:ubuntu-24.04-64:tests/nested/manual/muinstaller-real:partial
  • google-nested:ubuntu-24.04-64:tests/nested/manual/muinstaller-core:install_optional_snap
  • google-core:ubuntu-core-18-64:tests/core/kernel-base-gadget-single-reboot
  • google:ubuntu-20.04-64:tests/main/lxd:snapd_cgroup_neither
  • google:ubuntu-20.04-64:tests/main/preseed-core20
  • google:ubuntu-20.04-64:tests/main/snapd-state
  • google:ubuntu-24.10-64:tests/main/auto-refresh-gating
  • google:ubuntu-24.04-64:tests/main/auto-refresh-gating
  • google:ubuntu-24.04-64:tests/main/snapd-state

@ernestl ernestl changed the title release: 2.68.1 release: 2.68.2 Feb 26, 2025
Copy link
Member

@olivercalder olivercalder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link

codecov bot commented Feb 26, 2025

Codecov Report

Attention: Patch coverage is 72.87671% with 99 lines in your changes missing coverage. Please review.

Please upload report for BASE (release/2.68@8cc8d18). Learn more about missing BASE report.

Files with missing lines Patch % Lines
confdb/schema.go 75.65% 16 Missing and 12 partials ⚠️
seed/seedwriter/writer.go 51.28% 13 Missing and 6 partials ⚠️
overlord/fdestate/backend/reseal.go 82.53% 5 Missing and 6 partials ⚠️
image/image_linux.go 33.33% 8 Missing and 2 partials ⚠️
confdb/confdb.go 50.00% 5 Missing and 2 partials ⚠️
secboot/secboot_hooks.go 44.44% 4 Missing and 1 partial ⚠️
secboot/argon2_out_of_process_sb.go 85.18% 3 Missing and 1 partial ⚠️
boot/seal.go 0.00% 1 Missing and 2 partials ⚠️
secboot/argon2_out_of_process_dummy.go 0.00% 3 Missing ⚠️
boot/bootstate20.go 33.33% 0 Missing and 2 partials ⚠️
... and 4 more
Additional details and impacted files
@@               Coverage Diff               @@
##             release/2.68   #15141   +/-   ##
===============================================
  Coverage                ?   78.06%           
===============================================
  Files                   ?     1183           
  Lines                   ?   157654           
  Branches                ?        0           
===============================================
  Hits                    ?   123076           
  Misses                  ?    26930           
  Partials                ?     7648           
Flag Coverage Δ
unittests 78.06% <72.87%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ernestl
Copy link
Collaborator Author

ernestl commented Feb 27, 2025

Went through commits, there are many more test fixes that would make like easier, also some content that was missing. Started the process of picking these, will complete tomorrow morning.

bboozzoo and others added 10 commits February 27, 2025 09:48
Add -D_GNU_SOURCE so that clangd doesn't complain about O_PATH.

Signed-off-by: Maciej Borzecki <[email protected]>
Remove the quota group on restore so that it does not leak into
subsequent tests.

Signed-off-by: Maciej Borzecki <[email protected]>
We were hitting the 32 characters limit in the version because now the
kernel uses very long strings as version, line
5.15.0-130.140.1+1+535.216.03.
* updates needed to be applied on master for sru

* remove extra SNAPD_NO_MEMORY_LIMIT

* Update exit message for prompting tests

* updated the check for ubuntu 22.04

* move exit in apparmor-prompting-integration-tests

* extra chacks for apparmor promtping are gonna be done in a following pr

* tests: new test apparmor-prompting-support

This new test is used to validate the systems support for the apparmor
prompting feature.

Also as part of this change, some tests are updated to avoid checking
many times the same conditions.

* adding missing test

* add support for other non ubuntu systems

* updated the check for ubuntu 22+

* updated the tests based on latest comments

* updated interfaces-snap-interfaces-requests-control

* removed if to check non-ubuntu

* Minor changes in documentation

* run interfaces-snap-interfaces-requests-control just in ubuntu-2*

* fix support test for 20.04
* tests: switch to github-hosted arm runners

* tests: changed arm64 to arm in runner name check
We want to start to build for plucky. Additionally, update changelogs
with the new entries for latest upload of the ubuntu-core-initramfs
source package to the snappy-dev/image PPA.
…store (canonical#15135)

Despite groups not being assigned to any snaps, there are quota groups
related files created by system under /sys/fs/cgroup/. Make sure to
remove all groups and check that no files are left behind.

Signed-off-by: Maciej Borzecki <[email protected]>
@ernestl ernestl force-pushed the prepare-release-2.68.2 branch from d18bb09 to d15a958 Compare February 27, 2025 07:57
Copy link

github-actions bot commented Feb 27, 2025

Thu Feb 27 10:08:51 UTC 2025
The following results are from: https://github.com/canonical/snapd/actions/runs/13561510356

Failures:

Preparing:

  • google-nested:ubuntu-20.04-64:tests/nested/core/kernel-revert-after-boot
  • google-nested:ubuntu-20.04-64:tests/nested/manual/core20-fde-dbx
  • google-nested:ubuntu-22.04-64:tests/nested/manual/core20-fde-dbx
  • google-nested:ubuntu-22.04-64:tests/nested/manual/hybrid-fde-dbx
  • google-nested:ubuntu-24.04-64:tests/nested/manual/core20-fde-dbx
  • google-nested:ubuntu-24.04-64:tests/nested/manual/hybrid-fde-dbx
  • google-nested:ubuntu-24.04-64:tests/nested/manual/hybrid-remodel

Executing:

  • google-nested:ubuntu-24.04-64:tests/nested/manual/core20-remodel
  • google-nested:ubuntu-24.04-64:tests/nested/manual/muinstaller-real:encrypted
  • google-nested:ubuntu-24.04-64:tests/nested/manual/muinstaller-core:install_optional_snap_and_comp
  • google-nested:ubuntu-24.04-64:tests/nested/manual/muinstaller-real:partial
  • google-nested:ubuntu-24.04-64:tests/nested/manual/muinstaller-real:plain

Restoring:

  • google-distro-1:debian-11-64:tests/main/snap-quota
  • google-core:ubuntu-core-18-64:tests/main/snap-quota

@ernestl ernestl requested a review from olivercalder February 27, 2025 08:03
@ernestl
Copy link
Collaborator Author

ernestl commented Feb 27, 2025

Consider adding this if it gets done in time: #15146

@ernestl ernestl force-pushed the prepare-release-2.68.2 branch from d15a958 to 88bf1d1 Compare February 27, 2025 12:32
Copy link

github-actions bot commented Feb 27, 2025

Thu Feb 27 21:18:19 UTC 2025
The following results are from: https://github.com/canonical/snapd/actions/runs/13566451281

Failures:

Executing:

  • google-nested:ubuntu-24.04-64:tests/nested/manual/core20-remodel
  • google:ubuntu-25.04-64:tests/main/security-device-cgroups:uinput
  • google:ubuntu-25.04-64:tests/main/security-device-cgroups-serial-port
  • google:ubuntu-25.04-64:tests/main/security-device-cgroups-helper
  • google:ubuntu-25.04-64:tests/main/cgroup-devices-v2
  • google:ubuntu-25.04-64:tests/main/security-device-cgroups-self-manage
  • google:ubuntu-25.04-64:tests/main/snap-user-service-socket-activation
  • google:ubuntu-25.04-64:tests/main/security-device-cgroups:kmsg
  • google:ubuntu-25.04-64:tests/main/security-device-cgroups-strict-enforced
  • google:ubuntu-25.04-64:tests/main/security-device-cgroups-required-or-optional
  • google:ubuntu-25.04-64:tests/main/snap-ns-forward-compat
  • google:ubuntu-22.04-64:tests/main/prepare-image-classic

Restoring:

  • google:ubuntu-25.04-64:tests/main/security-device-cgroups-strict-enforced

Copy link
Member

@alfonsosanchezbeato alfonsosanchezbeato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you

Copy link
Member

@olivercalder olivercalder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Copy link
Contributor

@bboozzoo bboozzoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ZeyadYasser
Copy link
Contributor

ZeyadYasser commented Feb 28, 2025

Regarding the google:ubuntu-22.04-64:tests/main/prepare-image-classic spread failure, this is caused by an extra warning for incompatible snapd 2.68+ with and older kernel containing snapd prior to 2.68 which was added in #15106.

It is safe to ignore this, since it only fails when counting output lines from prepare-image which of course has an extra warning now, I re-ran the test against the release branch without the line count check, and it passed. I will create a PR shortly to fix the test.

Fix PR merged: #15150

Running prepare-image as a user
+ su -c 'SNAPPY_USE_STAGING_STORE=0 snap prepare-image --classic --channel edge /home/test/tmp//model.assertion /home/test/tmp/' test
Fetching snapd (24138)
Fetching pc-kernel (2266)
Fetching core22 (1841)
Fetching pc (194)
+ cat stderr
WARNING: snapd 2.68+ is not compatible with a kernel containing snapd prior to 2.68
WARNING: ensure that the contents under /home/test/tmp/system-seed are owned by root:root in the (final) image
+ MATCH 'WARNING: ensure that the contents under .* are owned by root:root in the \(final\) image'
+ wc -l
+ MATCH '^1$'
grep error: pattern not found, got:
2
-----
.
2025-02-28 09:35:08 Debug output for google:ubuntu-22.04-64:tests/main/prepare-image-classic (feb280729-100793) : 
-----
+ cat stderr
WARNING: snapd 2.68+ is not compatible with a kernel containing snapd prior to 2.68
WARNING: ensure that the contents under /home/test/tmp/system-seed are owned by root:root in the (final) image

Copy link
Collaborator

@pedronis pedronis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@zyga
Copy link
Contributor

zyga commented Feb 28, 2025

@ernestl cgroup failures are due to gce kernel misalignment, they all pass with normal ubuntu images in qemu.

The socket activation failure is due to apparmor release, not affecting snapd, just tests. I've prepared a fix locally.

@ernestl
Copy link
Collaborator Author

ernestl commented Feb 28, 2025

Info from Zyga: Socket activitation issue relates to apparmor update in base distro, not a snapd regression.

@maykathm
Copy link
Contributor

@ernestl The snap-ns-forward-compat error is due to the addition of a new apparmor profile affecting unshare, which is called directly in the test in question. It is a test issue, not a snapd issue.

@ernestl
Copy link
Collaborator Author

ernestl commented Feb 28, 2025

Info from Alfonso: The core20-remodel problem in this case is the seed partition size, that is specified in the gadget, so a test issue. We will test in parallel after increasing the size, to ensure this is the only problem, but not hold back release.

@ernestl ernestl merged commit 999075b into canonical:release/2.68 Feb 28, 2025
73 of 79 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Samuele review Needs a review from Samuele before it can land Run nested The PR also runs tests inluded in nested suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.