Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/images/trident-container-installer/base/baseimg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ os:
- mdadm
- moby-engine
- openssh-server
- selinux-policy
- squashfs-tools
- tar
- vim
Expand All @@ -53,6 +54,8 @@ os:
destination: /root/.profile
- source: files/trident-container.service
destination: /usr/lib/systemd/system/trident-container.service
- source: files/containerd-mmap-fix.cil
destination: /usr/share/selinux/packages/containerd-mmap-fix.cil

services:
enable:
Expand All @@ -62,6 +65,7 @@ os:
scripts:
postCustomization:
- path: scripts/post-install.sh
- path: scripts/load-containerd-selinux-fix.sh

iso:
additionalFiles:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
; Fix for containerd 2.2+ MountManager plugin SELinux denial.
; containerd 2.2 introduces a MountManager that opens a bbolt DB under
; /run/containerd/ using mmap(). The base refpolicy (RELEASE_2_20240226)
; grants manage_file_perms on container_runtime_t:file but that set does
; not include 'map'. Upstream fixed this in commit 7876e51510 (May 2024).
; This module backports the missing permission.
(allow container_engine_system_domain container_runtime_t (file (map)))
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
# Load SELinux policy module that grants the 'map' permission on
# container_runtime_t:file for container engines. This fixes containerd
# 2.2+ MountManager bbolt mmap() denials under enforcing mode.
semodule -i /usr/share/selinux/packages/containerd-mmap-fix.cil
4 changes: 4 additions & 0 deletions tests/images/trident-container-testimage/base/baseimg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,15 @@ os:

- docker-cli
- moby-engine
- selinux-policy
- squashfs-tools
- tar

additionalFiles:
- source: files/trident-container.service
destination: /usr/lib/systemd/system/trident-container.service
- source: files/containerd-mmap-fix.cil
destination: /usr/share/selinux/packages/containerd-mmap-fix.cil

services:
enable:
Expand All @@ -81,3 +84,4 @@ os:
scripts:
postCustomization:
- path: scripts/post-install.sh
- path: scripts/load-containerd-selinux-fix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
; Fix for containerd 2.2+ MountManager plugin SELinux denial.
; containerd 2.2 introduces a MountManager that opens a bbolt DB under
; /run/containerd/ using mmap(). The base refpolicy (RELEASE_2_20240226)
; grants manage_file_perms on container_runtime_t:file but that set does
; not include 'map'. Upstream fixed this in commit 7876e51510 (May 2024).
; This module backports the missing permission.
(allow container_engine_system_domain container_runtime_t (file (map)))
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
# Load SELinux policy module that grants the 'map' permission on
# container_runtime_t:file for container engines. This fixes containerd
# 2.2+ MountManager bbolt mmap() denials under enforcing mode.
semodule -i /usr/share/selinux/packages/containerd-mmap-fix.cil
Loading