[Bug 2065964] Re: test-execute fails because of apparmor unprivileged userns restrictions

Launchpad Bug Tracker 2065964 at bugs.launchpad.net
Tue Jun 4 19:47:26 UTC 2024


This bug was fixed in the package systemd - 255.4-1ubuntu8.1

---------------
systemd (255.4-1ubuntu8.1) noble; urgency=medium

  * debian/systemd-resolved.postinst: ignore cp failure (LP: #2047975)
  * debian/systemd.postinst: don't restart user managers if too old (LP: #2054761)
  * switch-root: use MS_MOVE for /run when switchig from initrd (LP: #2064096)
  * test: check for kernel.apparmor_restrict_unprivileged_userns (LP: #2065964)

 -- Nick Rosbrook <enr0n at ubuntu.com>  Fri, 17 May 2024 10:47:34 +0200

** Changed in: systemd (Ubuntu Noble)
       Status: Fix Committed => Fix Released

-- 
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:
  Fix Released

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 OK: 288 SKIP: 6 FAIL: 1
  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