After upgrading from bionic to focal, esm-cache.service hits apparmor denials
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ubuntu-advantage-tools (Ubuntu) |
Fix Released
|
High
|
Andreas Hasenack | ||
Xenial |
Fix Released
|
Undecided
|
Unassigned | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned | ||
Mantic |
Fix Released
|
Undecided
|
Unassigned | ||
Noble |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[ Impact ]
On ubuntu-
This ONLY happens if the version with the apparmor profiles is installed on a Focal system which has been upgraded from Bionic, using do-release-upgrade.
It seems that despite covering /usr/bin/ in the profile on Focal for commands like uname or systemctl, we don't account for /bin/. However, when coming from a Bionic system, /bin/ is an actual folder instead of a symlink (as expected on a fresh Focal machine).
This happens because of the usr-merge[1] effort. On fresh focal systems, we have symlinks replacing top-level directories like /bin, /sbin, and others:
root@f-pristine:~# ls -la /{bin,lib,
lrwxrwxrwx 1 root root 7 May 24 21:40 /bin -> usr/bin
lrwxrwxrwx 1 root root 7 May 24 21:40 /lib -> usr/lib
lrwxrwxrwx 1 root root 7 May 24 21:40 /lib -> usr/lib
lrwxrwxrwx 1 root root 9 May 24 21:40 /lib32 -> usr/lib32
lrwxrwxrwx 1 root root 9 May 24 21:40 /lib64 -> usr/lib64
lrwxrwxrwx 1 root root 10 May 24 21:40 /libx32 -> usr/libx32
lrwxrwxrwx 1 root root 8 May 24 21:40 /sbin -> usr/sbin
In bionic, these are actual directories:
root@b:~# ls -lad /{bin,lib,
drwxr-xr-x 1 root root 2472 Jun 7 2023 /bin
drwxr-xr-x 1 root root 438 Jun 7 2023 /lib
drwxr-xr-x 1 root root 438 Jun 7 2023 /lib
drwxr-xr-x 1 root root 40 Jun 7 2023 /lib64
drwxr-xr-x 1 root root 3694 Jun 7 2023 /sbin
In a focal system that was upgraded from bionic, the usr-merge is not done, and this focal system will retain the bionic top-level directories.
Logs:
2024-05-24 03:09:16,
2024-05-24 03:09:16,
May 24 03:09:09 rtp kernel: [237304.261953] audit: type=1400 audit(171653094
May 24 03:09:09 rtp kernel: [237304.456301] audit: type=1400 audit(171653094
May 24 03:09:09 rtp kernel: [237304.514651] audit: type=1400 audit(171653094
May 24 03:09:11 rtp kernel: [237306.797550] audit: type=1400 audit(171653095
May 24 03:09:11 rtp kernel: [237306.827422] audit: type=1400 audit(171653095
May 24 03:09:12 rtp kernel: [237307.022790] audit: type=1400 audit(171653095
May 24 03:09:12 rtp kernel: [237307.074546] audit: type=1400 audit(171653095
May 24 03:09:14 rtp kernel: [237309.142413] audit: type=1400 audit(171653095
2024-05-24 03:09:16,
1. https:/
[ Test Plan ]
These were caught by the automated verification tests for v32.2 in -proposed. If all of the automated verification tests pass for the version with the fix (32.3), then that will be considered a verification for this bug as well.
The specific tests to be executed for this are:
1. The Bionic to Focal upgrade tests:
- features/
- features/
- features/
2. The following Focal tests which verify the esm cache working:
- features/
- all of features/
[ Where problems could occur ]
The fix edits the template for the ubuntu_
Given the nature of the change needed for this fix, it is very unlikely that we are breaking anything else: we are making the rules more permissive than they were before. However, if any typo is present, we may be breaking the esm-cache.service as mentioned before.
Changed in ubuntu-advantage-tools (Ubuntu): | |
status: | New → Confirmed |
Changed in ubuntu-advantage-tools (Ubuntu): | |
assignee: | nobody → Andreas Hasenack (ahasenack) |
importance: | Undecided → High |
status: | Confirmed → In Progress |
description: | updated |
description: | updated |
description: | updated |
I spoke to Andreas and Renan about this bug just now. I'm told that 32.2 in proposed passes all verification tests against the exceptional test plan except for this bug. But we also need this bug fixed and don't want to have to wait for the additional time a full test rerun would take along with a further ageing period.
If we were to land exceptional SRU from proposed into updates right now, then perform a regular SRU for a 32.3 with this bug fixed, then the second SRU would only require normal SRU verification for the particular fix being applied (test plan to include both the B->F upgrade case and the fresh installation F case, but checking apparmor behaviour only).
Given that exceptional test plan verification against 32.2 is already complete and passed except for this bug, I think that not releasing 32.2 in proposed currently, replacing it with a 32.3, and then SRU-verifying only this bug is equivalent from a QA perspective and therefore acceptable and preferable in this case. We would then be able to release 32.3 to updates as normal.
Plan of action:
1. Update this bug "Where problems could occur" with the specifics that Renan mentioned earlier, and link to this comment to explain what is going on from both this bug and tracking bug 2060732.
2. Complete the Test Plan for this bug to the satisfaction of one SRU team member (Andreas?) treating it as the Test Plan like one would for a regular SRU of this fix only (exercising AppArmor sufficiently for both the B->F upgrade and F fresh install cases and a smoke test to make sure the client still works if not included implicitly in exercising AppArmor is sufficient IMHO; use of automation is fine as always).
3. Complete the verification report for 32.2 in bug 2060732 as normal, except without the final change of the tags since we do not intend to release it.
4. Accept 32.3 into proposed (for all series) to address this bug 2067319. The upload should use -v to include the previous upload as well.
5. The bugs already verified (eg. tracking bug 2060732 but also any others previously verified) can be re-marked as verified with only a link to this comment as explanation (no re-verification required).
6. SRU-verify this bug 2067319 like you would a regular SRU.
7. Release when ready. I also agree that we can skip the ageing period as the only testing expected to be done is by us.