Commit 2cf4256
tests: [workaround] containerd 2.2 SELinux mmap denial for container images (#676)
## Summary
containerd 2.2+ introduces a MountManager plugin that `mmap()`s a bbolt
DB under `/run/containerd/`. The AZL 3.0 SELinux policy (refpolicy
`RELEASE_2_20240226`) grants `manage_file_perms` on
`container_runtime_t:file` which does **not** include the `map`
permission, causing a cascade failure that surfaces as:
\\\
docker: Error response from daemon: failed to create task for container:
unknown service containerd.services.tasks.v1.Tasks: not implemented
\\\
Upstream refpolicy fixed this in commit
[\7876e51510\](SELinuxProject/refpolicy@7876e51510)
(May 2024), but AZL's pinned version predates it.
## Validation
https://dev.azure.com/mariner-org/ECF/_build/results?buildId=1134778
## AZL bug
https://microsoft.visualstudio.com/OS/_workitems/edit/62602180
## Changes
- Add a CIL policy module (`containerd-mmap-fix.cil`) that grants the
missing `map` permission on `container_runtime_t:file` for
`container_engine_system_domain`
- Add `selinux-policy` package to both container images
- Load the CIL module during image build via a `postCustomization`
script
- Applied to both `trident-container-installer` and
`trident-container-testimage`
> **Note:** Existing workarounds (`enforcing=0` kernel param on
installer, `setenforce 0` in testimage service) are intentionally kept
in place. They should be removed in a follow-up PR after this fix is
validated.
## Related
- Upstream fix:
SELinuxProject/refpolicy@7876e51510
- Pipeline bugs: #20870, #20884, #20879, #20905
---------
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent db2e11c commit 2cf4256
6 files changed
Lines changed: 32 additions & 0 deletions
File tree
- tests/images
- trident-container-installer/base
- files
- scripts
- trident-container-testimage/base
- files
- scripts
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| 57 | + | |
| 58 | + | |
56 | 59 | | |
57 | 60 | | |
58 | 61 | | |
| |||
62 | 65 | | |
63 | 66 | | |
64 | 67 | | |
| 68 | + | |
65 | 69 | | |
66 | 70 | | |
67 | 71 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
73 | 74 | | |
74 | 75 | | |
| 76 | + | |
| 77 | + | |
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
| |||
81 | 84 | | |
82 | 85 | | |
83 | 86 | | |
| 87 | + | |
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments