惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Recent Announcements
Recent Announcements
J
Java Code Geeks
雷峰网
雷峰网
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
腾讯CDC
博客园 - 司徒正美
B
Blog RSS Feed
博客园 - 三生石上(FineUI控件)
I
InfoQ
N
Netflix TechBlog - Medium
L
LangChain Blog
博客园_首页
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Tailwind CSS Blog
MyScale Blog
MyScale Blog
美团技术团队
The Cloudflare Blog
爱范儿
爱范儿
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
H
Help Net Security
Martin Fowler
Martin Fowler
V
Visual Studio Blog

Arch Linux Forums

Avidemux crashes without strace / Applications & Desktop Environments how to apply patches with non-linux linends / Newbie Corner Replicating CachyOS on vanilla Arch (or at least getting close) / Arch Discussion What's arch linux GUI package manager ? / Newbie Corner Hibernation failing due to insufficient memory / System Administration profiledef.sh editting question / Installation trying to script kde plasma wallpaper settings / Programming & Scripting Looking for new Audacious package maintainer / Creating & Modifying Packages issues installing arch with LUKS2 encryption / Newbie Corner QEMU PXE booting does not work with OVMF.4m.fd / Applications & Desktop Environments Wired lan regular disconnect / Newbie Corner Need Help setting up ARCH in my G16 G634JZR iwlwifi started failing consistently, trying to determine root cause Windows randomly jumping between monitors after GNOME 50 update No display via DP or HDMI after boot. / Kernel & Hardware how to change acpi platform_profile? / Newbie Corner Linux denied all kernel modules which not loaded right now Use iPhone as Webcam for Arch Linux Video Output Failure on nvidia-580xx-dkms on TTY --> Desktop switch (Page 2) / Kernel & Hardware I was going to rant ..WINE32 Sabotage compliments of Arvind Krishna / Arch Discussion [SOLVED] LUKS drive auto unlocked by TPM when expected not to / Networking, Server, and Protection Hibernate/suspend from X = dark panel; from TTY = works (ASUS G14, hyb (Page 2) / Laptop Issues Headphone jack noise/buzz / Newbie Corner segmentation fault in cc1plus when building CLK / AUR Issues, Discussion & PKGBUILD Requests Console alternative to meld / GNU/Linux Discussion Problem with paru git clone / Newbie Corner XKB questions / Applications & Desktop Environments gnome-keyring-daemon is not working correctly / Applications & Desktop Environments [SOLVED] Steam opens and immediately closes constantly / Newbie Corner Firefox rounded edges on Sway / Applications & Desktop Environments
Permission problems with default apparmor enforced module...
virgula · 2026-06-16 · via Arch Linux Forums

Docker info:

Client:
 Version:    29.5.1
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  0.34.1
    Path:     /usr/lib/docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  5.1.3
    Path:     /usr/lib/docker/cli-plugins/docker-compose

Server:
 Containers: 2
  Running: 0
  Paused: 0
  Stopped: 2
 Images: 34
 Server Version: 29.5.1
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: true
  Native Overlay Diff: false
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: systemd
 Cgroup Version: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 64b425cf570b3b8dd1d4cc46da7c1fce65c6651a.m
 runc version: 
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: builtin
  cgroupns
 Kernel Version: 7.0.11-arch1-1
 Operating System: Arch Linux
 OSType: linux
 Architecture: x86_64
 CPUs: 12
 Total Memory: 14.39GiB
 Name: red-laptop-16124
 ID: 1bd39403-84b2-4463-ab82-328e6f12df94
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Username: virgula
 Experimental: false
 Insecure Registries:
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false
 Firewall Backend: iptables
  EnableUserlandProxy: true
  UserlandProxyPath: /usr/bin/docker-proxy

Hello,

I recently installed AppArmor on my arch distro instance

uname -r

7.0.11-arch1-1

cat /etc/os-release 
NAME="Arch Linux"
PRETTY_NAME="Arch Linux"
ID=arch
BUILD_ID=rolling
ANSI_COLOR="38;2;23;147;209"
HOME_URL="https://archlinux.org/"
DOCUMENTATION_URL="https://wiki.archlinux.org/"
SUPPORT_URL="https://bbs.archlinux.org/"
BUG_REPORT_URL="https://gitlab.archlinux.org/groups/archlinux/-/issues"
PRIVACY_POLICY_URL="https://terms.archlinux.org/docs/privacy-policy/"
LOGO=archlinux-logo
sudo pacman -S apparmor
sudo systemctl enable --now apparmor.service

with startup options in `/proc/cmdline` for the `GRUB`:

BOOT_IMAGE=/vmlinuz-linux root=UUID=XXXX rw cryptdevice=UUID=XXXX::cryptlvm rootfstype=ext4 apparmor=1 security=apparmor loglevel=3 quiet

without adding new profiles by doing `aa-stauts` I get default enforced ones like these:

9 profiles are in enforce mode.
   /usr/lib/apache2/mpm-prefork/apache2//phpsysinfo
   apache2//phpsysinfo
   chromium//opencl_pocl_clang
   chromium//opencl_pocl_ld
   docker-default
   firefox//opencl_pocl_clang
   firefox//opencl_pocl_ld
   systemd-coredump//opencl_pocl_clang
   systemd-coredump//opencl_pocl_ld

First of all as far as I understood the fact that the profile is not saved on the disk but loaded in memory and then deleted, is something done on purpose and is very frustrating not finding it in `/etc/apparmor.d/` location.

I think the `docker-default` profile is the one giving me troubles with docker rootfull installation, in fact:

docker run --rm hello-world
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: unable to start init: fork/exec /proc/self/fd/6: permission denied

Run 'docker run --help' for more information

and even this does not work:

docker run --rm --security-opt apparmor=unconfined hello-world
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: unable to start init: fork/exec /proc/self/fd/6: permission denied

Run 'docker run --help' for more information

For this reason I have created a mock trying to disable the in-memory module:

echo 'profile docker-default {}' | tee /etc/apparmor.d/docker-default
sudo aa-disable /etc/apparmor.d/docker-default

With this trick the module enforced is gone from the list:

8 profiles are in enforce mode.
   /usr/lib/apache2/mpm-prefork/apache2//phpsysinfo
   apache2//phpsysinfo
   chromium//opencl_pocl_clang
   chromium//opencl_pocl_ld
   firefox//opencl_pocl_clang
   firefox//opencl_pocl_ld
   systemd-coredump//opencl_pocl_clang
   systemd-coredump//opencl_pocl_ld

but docker still won't work:

docker run --rm hello-world
docker: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: unable to start init: fork/exec /proc/self/fd/6: permission denied

Run 'docker run --help' for more information, the only way to make it work is to tardown all loaded profiles:

Instead, unloading all profiles:

sudo aa-teardown
Unloading AppArmor profiles
docker run --rm hello-world

Hello from Docker!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    (amd64)
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

To try something more ambitious, you can run an Ubuntu container with:
 $ docker run -it ubuntu bash

Share images, automate workflows, and more with a free Docker ID:
 https://hub.docker.com/

For more examples and ideas, visit:
 https://docs.docker.com/get-started/

I need to use apparmor for other security reason but I can't if docker gives me this kind of problem. What is the problem? Does any other enforced profile restricts the behavior for `fork/exec /proc/self/fd/6`? How can I eventually disable it since I also tried to complain them all with `sudo aa-complain /etc/apparmor.d/*`