docker-default denies signals between a container's own processes when Ubuntu stacks the profile (`docker-default//&unconfined`)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 22/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- docker, go, linux
- Domain
- infrastructure, security
Research direction
The relevant rules are the signal and ptrace lines in apparmor/template.go in moby/profiles, which only allow peer={{.PeerName}}. Start by reading how that template is rendered and how the profile name is passed in, then reproduce the stacked label with cat /proc/<pid>/attr/current and dmesg | grep DENIED. Done means processes in a container under the stacked docker-default//&unconfined label can signal their own threads, and the template tests still pass.
Written by the indexing model from the issue text.
Description
Description
On Ubuntu 26.04 with kernel 7.0.0-1016-aws, processes in a container under docker-default cannot signal each other. The postgres image never starts. Its entrypoint runs gosu, gosu spins at full CPU, and the container writes no log output.
Ubuntu's apparmor package sets kernel.apparmor_restrict_unprivileged_unconfined=1 in /usr/lib/sysctl.d/10-apparmor.conf. runc runs unconfined and has no CAP_MAC_ADMIN when it changes profile. With that sysctl, the kernel turns runc's profile change into a stack:
apparmor="AUDIT" operation="change_onexec" info="change_profile unprivileged unconfined converted to stacking" profile="unconfined" name="/usr/local/bin/docker-entrypoint.sh" comm="runc:[2:INIT]" target="docker-default//&unconfined"
The container processes then have the label docker-default//&unconfined (enforce). The template in moby/profiles apparmor/template.go allows signals only to the literal profile name:
signal (send,receive) peer={{.PeerName}},
ptrace (trace,tracedby,read,readby) peer={{.PeerName}},
So AppArmor denies signals from a container process to its own threads:
apparmor="DENIED" operation="signal" class="signal" profile="docker-default" comm="gosu" requested_mask="send" denied_mask="send" signal=urg peer="docker-default//&unconfined"
apparmor="DENIED" operation="signal" class="signal" profile="docker-default" comm="gosu" requested_mask="send" denied_mask="send" signal=rtmin+1 peer="docker-default//&unconfined"
The stack depends on the kernel build. On 7.0.0-1014-aws, with the same AppArmor 5.0.2, Docker, containerd, runc, and sysctl value, the container gets the plain docker-default label and postgres starts normally. containerd has the same bug in its default profile: containerd/containerd#14485, with a proposed fix in containerd/containerd#14487.
Reproduce
- Use Ubuntu 26.04 with kernel 7.0.0-1016-aws, and leave
kernel.apparmor_restrict_unprivileged_unconfinedat its default of 1. docker run -d --name pg -e POSTGRES_PASSWORD=password postgres:16.13docker logs pgprints nothing.docker exec pg pg_isready -U postgresnever succeeds.cat /proc/$(pgrep -x gosu)/attr/currentprintsdocker-default//&unconfined (enforce).dmesg | grep DENIEDshows the signal denials above.
Workaround: set kernel.apparmor_restrict_unprivileged_unconfined=0 and start a new container. The container then gets docker-default, and postgres accepts connections in about 2 seconds. This weakens a host hardening setting, so it is not a good default fix.
Expected behavior
Processes in one container can signal each other under docker-default, with or without the stacked label. One possible fix is the same one that containerd#14487 proposes: also allow the stacked form of the peer, for example peer={{.PeerName}}//&unconfined, and nothing wider.
docker version
Docker Engine 29.4.2 (docker-ce 5:29.4.2-2~ubuntu.26.04~resolute)
containerd 2.4.2 (containerd.io 2.4.2-3~ubuntu.26.04~resolute)
runc 1.5.2
docker info
cgroup v2, storage driver overlayfs with the containerd snapshotter
Host: Ubuntu 26.04.1 LTS, kernel 7.0.0-1016-aws, arm64 (Graviton)
AppArmor 5.0.2-0ubuntu1~26.04.1
Additional Info
The host is a GitHub Actions runner image, based on actions/runner-images Ubuntu 26.04. Other reports of the same failure: AutomatosAI/automatos-ai#1401 (k3s) and Osmantic/ODS#7619 (docker exec).
- Dominant language
- Go
- Stars
- 72.2k
- Forks
- 19.3k
- Avg merge
- 1d 18h
- Merged PRs (30d)
- 157
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from moby/moby
-
hack/make: copy_binaries fails when only /usr/local/bin/runc is presentPossibly taken @aryansk claimed this 80 days ago. Openkind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
moby/moby#53442 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Bug in checking nDotsSet, should be nDotsSet and > 0, leads to failed container name resolution in DinDPossibly taken @NavneetNayak claimed this 115 days ago. Openkind/bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
moby/moby#53104 · 2 comments ·
Maintainers usually reply within 1 day
-
Endpoint (container) name is not passed to network-driver plugins at CreateEndpoint (unlike IPAM drivers, #50586)Possibly taken @claymore666 claimed this 150 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
Clarify target terminal for command examples in `docs/contributing/set-up-dev-env.md`May be free again A pull request for this issue was closed without being merged. Openkind/bug status/0-triage
Difficulty 1/5 Under an hour Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Default seccomp policy does not allow calling fanotify_init without CAP_SYS_ADMINPossibly taken @ychampion claimed this 123 days ago. Openarea/security/seccomp help wanted kind/enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
moby/moby#49756 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
Similar issues
-
backlog
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
EchoTools/nevr-runtime#2385 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 5 days
-
项目日志弹出窗尺寸可拉伸功能Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
bug good first issue priority: P2 status: ready
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
RhinoLink-Tech/data-fabric#502 ·
Maintainers usually reply within 1 day
-
sweep
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
bketelsen/truenas-mcp#65 ·
Maintainers usually reply within 1 day