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.63 #13887

Merged
merged 20 commits into from Apr 30, 2024
Merged

release: 2.63 #13887

merged 20 commits into from Apr 30, 2024

Conversation

ernestl
Copy link
Collaborator

@ernestl ernestl commented Apr 24, 2024

Merged master back into release branch and resolved conflicts created from minor back-porting/compatibility changes.

As discussed, it does not seem there much value in maintaining the In progress: section in NEWS.md, given that on release all content PRs are evaluated to determine the content accurately.

Merge changelogs back into master, please use a regular “merge” to merge it. This is required to introduce the commit history that includes the release tagged commit so that it is searchable on the master branch.

bboozzoo and others added 19 commits April 24, 2024 11:27
The tests seem to call real depmod which fails when building on LP:

```
----------------------------------------------------------------------
FAIL: setup_test.go:770: setupSuite.TestRemoveKernelModulesComponentsFails

setup_test.go:786:
    s.testSetupKernelModulesComponents(c, firstInstalled, nil, ksnap, kernRev, "")
setup_test.go:709:
    c.Assert(err, IsNil)
... value *exec.Error = &exec.Error{Name:"depmod", Err:(*errors.errorString)(0x4000118380)} ("exec: \"depmod\": executable file not found in $PATH")

----------------------------------------------------------------------
FAIL: setup_test.go:656: setupSuite.TestSetupAndRemoveKernelModulesComponents

setup_test.go:662:
    // Set-up and then remove
    s.testSetupKernelModulesComponents(c, toInstall, nil, ksnap, kernRev, "")
setup_test.go:709:
    c.Assert(err, IsNil)
... value *exec.Error = &exec.Error{Name:"depmod", Err:(*errors.errorString)(0x4000118380)} ("exec: \"depmod\": executable file not found in $PATH")

----------------------------------------------------------------------
FAIL: setup_test.go:666: setupSuite.TestSetupAndRemoveKernelModulesComponentsWithInstalled

setup_test.go:672:
    s.testSetupKernelModulesComponents(c, firstInstalled, nil, ksnap, kernRev, "")
setup_test.go:709:
    c.Assert(err, IsNil)
... value *exec.Error = &exec.Error{Name:"depmod", Err:(*errors.errorString)(0x4000118380)} ("exec: \"depmod\": executable file not found in $PATH")

OOPS: 164 passed, 3 FAILED
```

Make sure to have a default mock which fails and a mock the appropriate variant
in tests which require it.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
It is needed now on hybrid systems to be able to build the drivers
tree.
* tests: fix fake-netplan-apply test

The test was meant to fail in a clear way on unsupported releases but due to an
unintentional refactor, it was just running on the wrong base.

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

* tests: fake-netplan-apply equate jammy and mantic

Co-authored-by: Zeyad Yasser <zeyady98@gmail.com>

* tests: install core24 from edge for fake-netplan-apply

The netplan-snap is removed so that we can remove the base later.

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

---------

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Co-authored-by: Zeyad Yasser <zeyady98@gmail.com>
…13839)

The one from edge will always fail if we have FDE, make sure that
there are no false negatives because of that.
Ship the current version of snap-debug-info.sh script inside the snapd snapd, so
that folks no longer need to download it from snapd github repository.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
We do not need early mounts for the kernel in UC16/18, and causes
problems with systemd on UC16.
This fixes access to /etc/apparmor.d/tunables when running from snapd snap.
When snapd snap re-executes, and uses apparmor_parser from snapd snap (those
are separate conditions), then it re-directs the parser away from host
/etc/apparmor.d and we have special code to load tunables from the host anyway.
Those tunables are themselves conditional on the conditional include syntax
that may or may not be supported by apparmor (otherwise the would be explicitly
spelled out in the template, and not dynamically expanded with custom logic).

The problem was introduced along with patch
b98e4af (i/apparmor: support for home.d
tunables from /etc/ (snapcore#13118)), as the case for snap-update-ns was missed, and
the default expansion is an empty string.

Regression-testing this requires that we re-package snapd snap, so the test
will come in with a separate patch as it requires somewhat more effort to
behave correctly.

This issue was identified by Maciej Borzecki.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
…napcore#13842)

* o/snapstate: store unlinked component information in change

As we will need this information in the component discard task.

* o/snapstate: discard previous component on a component refresh

Only one can be installed in the system at the same time.

* tests/component: check removal of older component after refresh

* o/snapstate: add function to retrieve component setup

Add function to find ComponentSetup for a task that is part of the
tasks created to do a component operation.

* o/snapstate: store unlinked component in ComponentSetup

* o/snapstate/backend: remove component related directories if empty

* o/snapstate: use SnapSetup to store the previous kernel revision

instead of having an object directly in the change.

* o/snapstate: store unlinked component in setup task

* o/snapstate: set previous kernel in setup task

instead of making it part of SnapSetup.

* o/snapstate: some additional tests
Ever since snapd 2.62 was released, snap-update-ns requires opening the home
directory of the user for some validation and sanity checking. This is now
affected by a bug in base policy regarding ecryptfs. Add the similar workaround
we have in other templates.

Fixes: https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/2062330
Fixes: https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/2062173

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
…ore#13858)

I've noticed this denial in one of my test systems:

  kwi 19 10:54:52 ubuntu-2204-cryptfs kernel: audit: type=1400
  audit(1713516892.723:323): apparmor="DENIED" operation="open" class="file"
  profile="snap-update-ns.chromium" name="/var/lib/snapd /" pid=8425 comm="5"
  requested_mask="r" denied_mask="r" fsuid=0 ouid=0

Given that snap-update-ns must access mount profiles and contains code to
safely traverse a path without any symbolic links, I think the extra
permissions is acceptable.

I did not audit the code to pinpoint the exact cause.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
…ainer (snapcore#13859)

* cmd/libsnap-confine-private: helper for detecting if executing inside a container

Add a helper which attempts to detect if the current process is executing inside
a container environment. Specifically, look for /run/systemd/container and check
whether it is non empty.

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

* cmd/snap-confine: do not setup device cgroup if running inside a container

Do not set up a device cgroup filter, if we're running inside the container. The
rationale is that the container environment has already shut down device access
sufficiently, and especially if running in unprivileged container, we may not be
able to set it up correctly anyway.

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

* cmd/snap-confine: allow reading of /run/systemd/container

Allow snap-confine to read /run/system/container to implement container
execution check.

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

* cmd/snap-confine: use strnlen for sc_is_container

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

---------

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
Co-authored-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
…napcore#13872)

Since 3cfa28a snap-confine checks if the system is running in a container. It
does so by reading /run/systemd/container. Extend the SELinux to allow basic
search operations within /run/systemd. It is unlikely anyone runs snapd in a
container where the SELinux is enabled on the host, so the actual file read
permissions are likely not needed.

Signed-off-by: Maciej Borzecki <maciej.borzecki@canonical.com>
…e#13874)

The test uses host parser unconditionally, which may not understand
future syntax that is present in cases when apparmor is carried
by snapd snap package.

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
…generation (snapcore#13847)

The nvidia container toolkit needs to traverse the top level libs
directory in order to discover the libraries and generate a CDI config.
…e#13882)

Snapd from the snap generate udev rules that executes snap-device-helper
from the host. In cases when the snap is newer than the package, the
new command line is rejected by the old snap-device-helper from the
package. Because the new snap-device-helper accepts old command-line,
but just ignores the extra parameters, it is safer for now to generate
rules with the old command line.
@ernestl ernestl added Simple 😃 A small PR which can be reviewed quickly Skip spread Indicate that spread job should not run labels Apr 24, 2024
Copy link
Collaborator

@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.

Thanks

Comment on lines -1 to -2
# In progress:
* Installation of local snap components
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we haven't completed this yet, so the in progress part likely needs to be restored

@zyga
Copy link
Collaborator

zyga commented Apr 25, 2024

@ernestl can we merge more than just the changelogs? Can we merge the tagged commit back to master?

@bboozzoo
Copy link
Collaborator

Ah I missed that it's just one commit here. What we need is a merge from the release branch to master., otherwise the tags will not show up properly in the commit sequence and we'll be stuck with 2.58 as the most recent tag on master

@github-actions github-actions bot added the Run Nested -auto- Label automatically added in case nested tests need to be executed label Apr 26, 2024
@bboozzoo
Copy link
Collaborator

Looked at the history and it looks correct:

*   a1a804c82d (HEAD -> changelogs-2.63) Merge branch 'master' into changelogs-2.63
|\  
| * a4a0fde171 tests: add details to some of the tests in main suite (part two) (#13885)
| * c29e264468 tests: include details to a set of tests - part 8 (#13863)
| * ddcf5bd8a6 tests: add details to a new set of tests - part 10 (#13865)
| * 635f5a6a24 usersession/agent: implement support for enable and disable functionality in service code
| * 8a0b9b2dcf interfaces/udev: generate rules with deprecated command line (#13882)
| * 2cb62c45c6 interfaces/opengl: enable use of nvidia container toolkit CDI config generation (#13847)
| * 61572ada45 tests: document nested suites (#13879)
| * 4128e3fea9 tests: document smoke/versioning (#13881)
| * 0bfb92bd39 tests: add ubuntu noble to the google-nested-dev backend
| * 1e60c120f8 tests: document nightly/sbuild
| * 4cc05c6929 tests/regression: skip lp-1848567 if internal parser is used (#13874)
| * db212c04f8 tests: add details to regression tests (#13877)
| * d6668f5147 data/selinux: update policy to allow stat of /run/systemd/container (#13872)
| * 521e904982 many: support user-daemons in QueryDisabledServices
| * f2c7b3f9ed tests: import tests with details from snapd-testing-tools (#13846)
| * 6baa7410d4 interfaces: fix typo: calculate
| * c833182430 o/snapshotstate: fix typo: calculate
| * 36845f09d3 o/snapshotstate: fix typo: backend
| * bbb3bad640 o/snapshotstate: fix typo: abandoned
| * a6e8a36e1b o/snapshotstate: fix typo: formatting
| * 2c54b54b4a tests/regression: fix typo: having
| * 20ac7d59ef tests: add noble to qemu-nested backend
| * 5499c72180 tests: document upgrade/selinux-relabel
| * 9f92b223f5 tests: document upgrade/basic
| * 098a240aa3 tests: fix typo: downloading
| * b30c3f564e tests: document unit/shell-traps (tweaks)
| * be8b04db6f tests: document unit/go
| * e9521f0164 tests: document unit/c-unit-tests-gcc
| * cc59872ce0 tests: document unit/c-unit-tests-clang
| * 62f820eb37 tests: document smoke/find-info
| * ae69eff8ac tests: document smoke/install
| * 32c0008d02 tests: document smoke/remove
| * 910e3d0b88 tests: document smoke/sandbox
| * c818da926d tests/smoke: fix typo: required
| * a339072caa tests/smoke: fix typo: secondary
| * 6e5dbd53cd po: document process to generate launchpad translations
| * 3cfa28a0fc cmd/snap-confine: skip device cgroup setup when running inside a container (#13859)
| * 8edebfd988 i/apparmor: allow snap-update-ns to traverse to /var/lib/snapd (#13858)
| * 5ca13c7dec i/apparmor: fix snap-update-ns with ecrypfs home (#13857)
| * 83735930ae o/snapstate,tests: discard previous component on a component refresh (#13842)
| * 63a26ef1b7 i/apparmor: add missing expansion for s-u-n template (#13853)
| * b616df5137 o/snapstate: use StartBeforeDriversLoad only for systems with modes
| * 5b5b54f146 daemon, o/snapstate, snap: add hooks to snap.ComponentInfo (#13771)
| * c679f43577 s/cgroup, systemd: escape systemd unit names in CreateTransientScopeForTracking (#13763)
| * 5503e21dda build-aux/snap: ship snap-debug-info.sh script
| * 031dc4d8d1 tests: enable nested uc24 (#13820)
| * 4484bbe60b desktop/notification/notificationtest: fix data races
| * e1b57d6ad2 o/configstate/configcore: fix data races in unit tests
| * 02116ef645 dbusutil/netplantest: add way to sync, and sync access to exported API objects
| * 11d242dada tests: Ensure that parseOptionalTime honors nanoseconds (#13819)
| * 333b6577af seed: stop span before returning job outcome
| * 1f08a35d08 seccomp-support: check filter length value before reading
| * cd87e9b387 tests: update go version used in nightly workflow (#13838)
| * 164fe8aa34 tests/core20-kernel-failover: use kernel from beta channel (#13839)
| * d98a6b5b9a tests: fix fake-netplan-apply test (#13808)
| * 5531b2c01b tests/core20-kernel-failover: increase timeout waiting for try-kernel (#13835)
| * 1b260285b8 tests: add missing dependency to nightly workflow (#13834)
| * fe0ce14314 packaging: add kmod as Depends (#13830)
| * 3af6a4d853 overlord/snapstate/backend: mock depmod
* | 40efd81c2f (tag: 2.63, upstream/release/2.63) release: 2.63
* | b32dcdcd2e interfaces/udev: generate rules with deprecated command line (#13882)
* | e56b10fb43 interfaces/opengl: enable use of nvidia container toolkit CDI config generation (#13847)
* | b6f8ab33f6 tests/regression: skip lp-1848567 if internal parser is used (#13874)
* | bf3af32bbc data/selinux: update policy to allow stat of /run/systemd/container (#13872)
* | e63665aa2c cmd/snap-confine: skip device cgroup setup when running inside a container (#13859)
* | 9baeee4891 i/apparmor: allow snap-update-ns to traverse to /var/lib/snapd (#13858)
* | e95b8018df i/apparmor: fix snap-update-ns with ecrypfs home (#13857)
* | 35fed3fed9 overlord/snapstate: fix calls to compMntDir
* | 63324f0418 overlord/snapstate: fix calls to createTestComponent
* | 6d806a77ac o/snapstate,tests: discard previous component on a component refresh (#13842)
* | 46b66c4f00 i/apparmor: add missing expansion for s-u-n template (#13853)
* | 01abd57b52 o/snapstate: use StartBeforeDriversLoad only for systems with modes
* | ec6a5418d5 build-aux/snap: ship snap-debug-info.sh script
* | 7277b01904 tests/core20-kernel-failover: use kernel from beta channel (#13839)
* | 3bda7ef03a tests: fix fake-netplan-apply test (#13808)
* | f16e7774a8 tests/core20-kernel-failover: increase timeout waiting for try-kernel (#13835)
* | bdeb1a9cf0 packaging: add kmod as Depends (#13830)
* | 4e8dbc5523 overlord/snapstate/backend: mock depmod
|/  
* 2b786bf02f cmd: snap-bootstrap: fix unpreseeded sigle boot install (#13475)

Copy link
Collaborator

@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

I've merged this to master locally and things look ok.

@ernestl ernestl removed the Run Nested -auto- Label automatically added in case nested tests need to be executed label Apr 30, 2024
@ernestl ernestl closed this Apr 30, 2024
@ernestl ernestl reopened this Apr 30, 2024
@ernestl ernestl merged commit 3c8cbf4 into snapcore:master Apr 30, 2024
93 of 96 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Simple 😃 A small PR which can be reviewed quickly Skip spread Indicate that spread job should not run
Projects
None yet
7 participants