Skip to content

Commit 4fe5b0f

Browse files
authored
fix(ci): allow pasta to receive Podman stop signals (#2900)
* fix(ci): allow pasta to receive Podman stop signals Signed-off-by: Evan Lezar <elezar@nvidia.com> * test(ci): fail on pasta SIGTERM denial Signed-off-by: Evan Lezar <elezar@nvidia.com> * test(ci): retain AppArmor denial diagnostics Signed-off-by: Evan Lezar <elezar@nvidia.com> --------- Signed-off-by: Evan Lezar <elezar@nvidia.com>
1 parent aa848f1 commit 4fe5b0f

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

.github/workflows/e2e-test.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ jobs:
197197
run: |
198198
sudo apt-get update
199199
sudo apt-get install -y --no-install-recommends \
200+
apparmor \
200201
build-essential \
201202
clang \
202203
fuse-overlayfs \
@@ -219,6 +220,20 @@ jobs:
219220
echo "/usr/bin" >> "${GITHUB_PATH}"
220221
echo "CONTAINERS_CONF_OVERRIDE=${podman_config}" >> "${GITHUB_ENV}"
221222
223+
- name: Allow pasta to receive Podman stop signals
224+
# Ubuntu's packaged pasta profile currently blocks this signal, forcing
225+
# Podman to wait for its SIGKILL fallback. Keep this narrow allowance
226+
# until the distribution package includes the upstream profile fix.
227+
run: |
228+
set -euo pipefail
229+
profile=/etc/apparmor.d/usr.bin.pasta
230+
rule=' signal (receive) peer=podman,'
231+
if ! sudo grep -Fqx "${rule}" "${profile}"; then
232+
sudo sed -i '\|^ include <abstractions/pasta>$|a\ signal (receive) peer=podman,' "${profile}"
233+
fi
234+
sudo grep -Fqx "${rule}" "${profile}"
235+
sudo apparmor_parser --replace "${profile}"
236+
222237
- name: Configure rootless Podman
223238
run: |
224239
set -euo pipefail
@@ -279,6 +294,17 @@ jobs:
279294
if: always()
280295
run: sudo dmesg | grep -E 'apparmor=.*DENIED|profile="unprivileged_userns"' | tail -100 || true
281296

297+
- name: Fail on pasta SIGTERM AppArmor denial
298+
if: always()
299+
run: |
300+
set -euo pipefail
301+
denials="$(sudo dmesg | grep -E 'profile="pasta".*requested_mask="receive".*signal=term.*peer="podman"' || true)"
302+
if [ -n "${denials}" ]; then
303+
echo "::error::pasta denied Podman's SIGTERM; Podman will use its SIGKILL fallback"
304+
printf '%s\n' "${denials}"
305+
exit 1
306+
fi
307+
282308
e2e-vm:
283309
name: E2E (rust-vm-${{ matrix.suite }})
284310
# libkrun needs KVM, so this job must run directly on a GitHub-hosted

0 commit comments

Comments
 (0)