Update: this turned out to be a Docker AppArmor profile issue, now fixed 
upstream
in Docker (not yet released).

Root cause: with kernel.apparmor_restrict_unprivileged_unconfined=1, container
processes on 7.0.0-42+ get the stacked label "docker-default//&unconfined".
Docker's generated docker-default profile only has
"signal (send,receive) peer=docker-default" (and the same for ptrace), so
signals between a container's own threads are denied. Go's all-threads setuid
(gosu 1.19) never gets its SIGRTMIN+1 acknowledged and spins forever.

Upstream:
- Issue: https://github.com/moby/moby/issues/54099
- Fix:   https://github.com/moby/profiles/commit/12c7436
         ("apparmor: Handle stacked container processes", adds signal/ptrace
         rules for peer=<name>//&unconfined)
- Vendored for Docker 29.11.0: https://github.com/moby/moby/pull/54266

Verified locally on 7.0.0-44 (i5-4250U): with a docker-default profile
containing the added stacked-label rules, gosu completes instantly, there are 0
AppArmor denials, and all mariadb/postgres/mongo containers start normally.
Without them, the hang reproduces on -42, -43 and -44. Kernel 7.0.0-38 is not
affected (no stacked label on that kernel).

Note that dockerd re-installs its own docker-default profile at daemon startup,
so a locally pre-loaded fixed profile is overwritten on boot. Users need a
Docker release that includes the fix.

Ubuntu's docker.io package generates the same profile, so it presumably needs
the moby/profiles fix backported. Suggest adding docker.io (Ubuntu) as an
affected package. The linux task can probably be marked Invalid, unless the
change that started producing the stacked label in -42 was unintended.


** Bug watch added: github.com/moby/moby/issues #54099
   https://github.com/moby/moby/issues/54099

** Also affects: linux via
   https://github.com/moby/moby/issues/54099
   Importance: Unknown
       Status: Unknown

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2172422

Title:
  Regression 7.0.0-42/-43: Go 1.24 programs livelock in setuid (gosu);
  official DB Docker images hang on start

To manage notifications about this bug go to:
https://bugs.launchpad.net/linux/+bug/2172422/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to