[Bug 2065964] [NEW] test-execute fails because of apparmor unprivileged userns restrictions
Nick Rosbrook
2065964 at bugs.launchpad.net
Fri May 17 08:41:53 UTC 2024
Public bug reported:
[Impact]
unit-tests in noble currently fails because test-execute fails with the
following:
1633s exec-basic.service: Child 1934 belongs to exec-basic.service.
1633s exec-basic.service: Control process exited, code=exited, status=0/SUCCESS (success)
1633s exec-basic.service: Got final SIGCHLD for state start-post.
1633s exec-basic.service: Deactivated successfully.
1633s exec-basic.service: Service will not restart (restart setting)
1633s exec-basic.service: Changed start-post -> dead
1633s exec-basic.service: Consumed 49ms CPU time.
1633s Spawning process to nuke '/tmp/systemd-private-dbf1f9a2e08f4741900f145a35ce7e30-exec-basic.service-ItwK5c'
1633s Successfully forked off intermediary '(sd-rmrf)' as PID 1936.
1633s Spawning process to nuke '/var/tmp/systemd-private-dbf1f9a2e08f4741900f145a35ce7e30-exec-basic.service-V50z4Q'
1633s Successfully forked off intermediary '(sd-rmrf)' as PID 1937.
1633s src/test/test-execute.c:1121:test_exec_basic: exec-basic.service: can_unshare=no: exit status 0, expected 226
1633s Skipping PR_SET_MM, as we don't have privileges.
1633s Skipping PR_SET_MM, as we don't have privileges.
1633s (test-execute-unprivileged) terminated by signal ABRT.
1633s Assertion 'r >= 0' failed at src/test/test-execute.c:1412, function prepare_ns(). Aborting.
1633s
[...]
1678s [1mOK: 288 SKIP: 6 FAIL: 1[0m
1679s autopkgtest [20:59:40]: test unit-tests: -----------------------]
1679s autopkgtest [20:59:40]: test unit-tests: - - - - - - - - - - results - - - - - - - - - -
1679s unit-tests FAIL non-zero exit status 1
This is because some tests in test-execute run unprivileged, and try to
user user namespaces. I fixed this upstream[1], so just backport the
patch so that this test case no longer fails.
[Test Plan]
This only pertains to the unit-tests autopkgtest in systemd. Just check
the result of the autopkgtest run.
[Where problems could occur]
This only changes the test-execute code to skip tests that require
unprivileged userns whenever
kernel.apparmor_restrict_unprivileged_userns=1. Hence, any problems
would be limited to that test case within unit-tests.
[Other information]
Note that the upstream-2 test still has regular failures which need to
be investigated, so this change will not get the systemd autopkgtests
back to green. Since I already fixed this upstream, it is easy to
backport, so it's worth making the incremental improvement for now.
[1]
https://github.com/systemd/systemd/commit/70aece819311f7ab76abdf473bc8f316c5bc58c6
** Affects: systemd (Ubuntu)
Importance: Undecided
Assignee: Nick Rosbrook (enr0n)
Status: Fix Committed
** Affects: systemd (Ubuntu Noble)
Importance: Medium
Assignee: Nick Rosbrook (enr0n)
Status: Triaged
** Tags: systemd-sru-next
** Also affects: systemd (Ubuntu Noble)
Importance: Undecided
Status: New
** Changed in: systemd (Ubuntu)
Status: New => Fix Committed
** Changed in: systemd (Ubuntu Noble)
Status: New => Triaged
** Changed in: systemd (Ubuntu Noble)
Assignee: (unassigned) => Nick Rosbrook (enr0n)
** Changed in: systemd (Ubuntu Noble)
Importance: Undecided => Medium
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/2065964
Title:
test-execute fails because of apparmor unprivileged userns
restrictions
Status in systemd package in Ubuntu:
Fix Committed
Status in systemd source package in Noble:
Triaged
Bug description:
[Impact]
unit-tests in noble currently fails because test-execute fails with
the following:
1633s exec-basic.service: Child 1934 belongs to exec-basic.service.
1633s exec-basic.service: Control process exited, code=exited, status=0/SUCCESS (success)
1633s exec-basic.service: Got final SIGCHLD for state start-post.
1633s exec-basic.service: Deactivated successfully.
1633s exec-basic.service: Service will not restart (restart setting)
1633s exec-basic.service: Changed start-post -> dead
1633s exec-basic.service: Consumed 49ms CPU time.
1633s Spawning process to nuke '/tmp/systemd-private-dbf1f9a2e08f4741900f145a35ce7e30-exec-basic.service-ItwK5c'
1633s Successfully forked off intermediary '(sd-rmrf)' as PID 1936.
1633s Spawning process to nuke '/var/tmp/systemd-private-dbf1f9a2e08f4741900f145a35ce7e30-exec-basic.service-V50z4Q'
1633s Successfully forked off intermediary '(sd-rmrf)' as PID 1937.
1633s src/test/test-execute.c:1121:test_exec_basic: exec-basic.service: can_unshare=no: exit status 0, expected 226
1633s Skipping PR_SET_MM, as we don't have privileges.
1633s Skipping PR_SET_MM, as we don't have privileges.
1633s (test-execute-unprivileged) terminated by signal ABRT.
1633s Assertion 'r >= 0' failed at src/test/test-execute.c:1412, function prepare_ns(). Aborting.
1633s
[...]
1678s [1mOK: 288 SKIP: 6 FAIL: 1[0m
1679s autopkgtest [20:59:40]: test unit-tests: -----------------------]
1679s autopkgtest [20:59:40]: test unit-tests: - - - - - - - - - - results - - - - - - - - - -
1679s unit-tests FAIL non-zero exit status 1
This is because some tests in test-execute run unprivileged, and try
to user user namespaces. I fixed this upstream[1], so just backport
the patch so that this test case no longer fails.
[Test Plan]
This only pertains to the unit-tests autopkgtest in systemd. Just
check the result of the autopkgtest run.
[Where problems could occur]
This only changes the test-execute code to skip tests that require
unprivileged userns whenever
kernel.apparmor_restrict_unprivileged_userns=1. Hence, any problems
would be limited to that test case within unit-tests.
[Other information]
Note that the upstream-2 test still has regular failures which need to
be investigated, so this change will not get the systemd autopkgtests
back to green. Since I already fixed this upstream, it is easy to
backport, so it's worth making the incremental improvement for now.
[1]
https://github.com/systemd/systemd/commit/70aece819311f7ab76abdf473bc8f316c5bc58c6
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2065964/+subscriptions
More information about the foundations-bugs
mailing list