Skip to content

fix: use Apparmor ABI 3 on Ubuntu <23.10 (release-4.1) #3000

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

Merged
merged 1 commit into from
Jun 13, 2024
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# SingularityCE Changelog

## Changes Since Last Release

### Bug Fixes

- Use ABI 3 for Apparmor profile on Ubuntu <23.10.

## 4.1.3 \[2024-05-08\]

### Requirements
Expand Down
4 changes: 3 additions & 1 deletion debian/apparmor-placeholder
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
abi <abi/4.0>,
# Placeholder unconfined policy for Singularity starter binaries.
# Uses AppArmor 3 ABI on Ubuntu <23.10
abi <abi/3.0>,
include <tunables/global>

profile singularity-ce /usr/lib/@{multiarch}/singularity/bin/starter{,-suid} flags=(unconfined) {
Expand Down
3 changes: 2 additions & 1 deletion debian/apparmor-userns
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Permit unprivileged user namespace creation for SingularityCE starter
# Permit unprivileged user namespace creation for SingularityCE starter.
# Uses AppArmor 4 ABI on Ubuntu >=23.10
abi <abi/4.0>,
include <tunables/global>

Expand Down
7 changes: 4 additions & 3 deletions debian/rules
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
srcver = $(shell scripts/get-version | sed -e 's,\(^[^+]\+\)-,\1~,; s,-,.,g')
dist = $(shell lsb_release -s -c)

OS_VERSION := $(shell grep ^VERSION_ID /etc/os-release | cut -d'=' -f2 | sed 's/\"//gI')
OS_MAJOR := $(shell grep ^VERSION_ID /etc/os-release | cut -d'=' -f2 | sed 's/\"//gI' | cut -d'.' -f1)

DH_VERBOSE=1
Expand Down Expand Up @@ -75,12 +76,12 @@ override_dh_auto_install:
# install standard build
cd $(SRCDIR)/$(DH_GOPKG) && \
make -C builddir install
# Apparmor userns profile needed on Ubuntu 24.04, or unconfined placeholder for older versions.
if [ $(OS_MAJOR) -gt 23 ] ; then \
# Apparmor userns profile needed on Ubuntu >=23.10, or unconfined placeholder for older versions.
if [ $(OS_MAJOR) -gt 23 ] || [ "$(OS_VERSION)" = "23.10" ]; then \
echo "Ubuntu 24.04 or newer - installing apparmor userns profile"; \
install -D -m 644 debian/apparmor-userns $(DESTDIR)/etc/apparmor.d/singularity-ce; \
else \
echo "Ubuntu 23.10 or older - installing apparmor placeholder profile"; \
echo "Ubuntu 23.04 or older - installing apparmor placeholder profile"; \
install -D -m 644 debian/apparmor-placeholder $(DESTDIR)/etc/apparmor.d/singularity-ce; \
fi;
dh_apparmor --profile-name=singularity-ce
Expand Down