-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Description
runc 1.3.3 fails in unprivileged Proxmox LXC with "permission denied" on sysctl
Description
After upgrading to runc 1.3.3-0ubuntu1~22.04.2, all Docker containers fail to start in unprivileged Proxmox LXC containers with nesting enabled. The error occurs when runc attempts to access /proc/sys/net/ipv4/ip_unprivileged_port_start through a detached procfs mount, which AppArmor interprets as accessing /sys/net/ipv4/ip_unprivileged_port_start and denies.
This appears to be related to CVE-2025-52881 and the security fix that introduced detached procfs mounts to prevent mount race attacks. The issue affects production systems running Docker in Proxmox LXC containers.
Error:
OCI runtime create failed: runc create failed: unable to start container process:
error during container init: open sysctl net.ipv4.ip_unprivileged_port_start file:
reopen fd 8: permission denied: unknown
Steps to reproduce the issue
-
Create an unprivileged Proxmox LXC container with Ubuntu 22.04:
pct create 114 local:vztmpl/ubuntu-22.04-standard_22.04-1_amd64.tar.zst \ --features nesting=1,keyctl=1 \ --unprivileged 1 \ --memory 2048 \ --cores 4
-
Install Docker inside the LXC container:
apt-get update apt-get install -y docker.io docker-compose
-
Upgrade runc to 1.3.3:
apt-get update apt-get install runc=1.3.3-0ubuntu1~22.04.2
-
Try to start any Docker container:
docker run --rm hello-world
Describe the results you received and expected
Expected result:
Container starts successfully.
Actual result:
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: error during container init:
open sysctl net.ipv4.ip_unprivileged_port_start file:
reopen fd 8: permission denied: unknown.
All containers fail with exit code 126 (permission denied).
Docker logs show:
failed to start container: failed to create task for container:
failed to create shim task: OCI runtime create failed: runc create failed:
unable to start container process: error during container init:
open sysctl net.ipv4.ip_unprivileged_port_start file:
reopen fd 8: permission denied: unknown
What version of runc are you using?
Failing version:
runc version 1.3.3-0ubuntu1~22.04.2
spec: 1.2.1
go: go1.23.1
libseccomp: 2.5.3
Working version (after downgrade):
runc version 1.1.0-0ubuntu1
spec: 1.0.2-dev
go: go1.17.3
libseccomp: 2.5.3
Host OS information
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
Container Configuration:
- Proxmox VE 8.2.2
- Unprivileged LXC container
- Features: nesting=1, keyctl=1
- OS Type: ubuntu
Host kernel information
Linux TeslaMate 6.8.4-3-pve #1 SMP PREEMPT_DYNAMIC PMX 6.8.4-3 (2024-05-02T11:55Z) x86_64 x86_64 x86_64 GNU/Linux
Additional Information
Timeline of Issue
- 2025-11-06 06:07 UTC: Ubuntu's
unattended-upgradeautomatically upgraded runc from 1.1.12 to 1.3.3 - 2025-11-06 ~07:56 UTC: After LXC container restart, all Docker containers failed to start
Root Cause Analysis
The security fix in runc 1.3.3 uses detached procfs mounts to prevent mount race attacks. When runc tries to write to /proc/sys/net/ipv4/ip_unprivileged_port_start, AppArmor's path-based security model misinterprets the detached mount path as /sys/net/... which is blocked by Proxmox LXC's AppArmor profile.
Attempted Fixes (Unsuccessful)
-
Modified AppArmor profile
/etc/apparmor.d/abstractions/lxc/container-base:- Changed
deny /sys/[^fdc]*todeny /sys/[^fdcn]*(to allow/sys/net) - Added explicit rule:
/sys/net/** rw, - Added:
/proc/sys/net/ipv4/ip_unprivileged_port_start w, - Reloaded profiles with
apparmor_parser -r /etc/apparmor.d/lxc-containers - Result: Still failed with same error
- Changed
-
Set sysctl on host level:
sysctl -w net.ipv4.ip_unprivileged_port_start=0
- Result: Did not resolve the issue
Working Workaround
Downgrade to runc 1.1.0:
apt-get install -y --allow-downgrades runc=1.1.0-0ubuntu1
apt-mark hold runcNote: This workaround loses the security fixes from runc 1.3.3 (including fixes for 3 container escape vulnerabilities).
Related Issues
This issue has been reported in multiple projects:
- nested docker 28.5.2 unable start containers; net.ipv4.ip_unprivileged_port_start permission denied lxc/incus#2623 - Incus team implemented an AppArmor fix
- [Docker, Inc.'s package] net.ipv4.ip_unprivileged_port_start permission denied only on 1.7.28-2~debian.13~trixie containerd/containerd#12484 - containerd discussion
- CVE-2025-52881: fd reopening causes issues with AppArmor profiles (
open sysctl net.ipv4.ip_unprivileged_port_start file: reopen fd 8: permission denied) #4968 - CVE-2025-52881 tracking - https://forum.proxmox.com/threads/docker-inside-lxc-net-ipv4-ip_unprivileged_port_start-error.175437/ - Proxmox forum
The Incus fix (PR #2624) modified AppArmor to allow /sys/net access, but this same fix doesn't appear to work in Proxmox LXC environments.
Impact
This affects all users running:
- Docker in unprivileged Proxmox LXC containers with nesting
- Any container runtime using runc 1.3.3 in similar environments
- Production systems that receive automatic security updates
Questions
- Is the AppArmor fix approach the correct solution for Proxmox LXC?
- Should runc handle the AppArmor denial more gracefully?
- Is there a way to make runc skip this sysctl modification when it's already appropriately set at the host level?
- Should there be a runtime flag to disable this specific sysctl modification for nested container environments?
System Details
- Docker: 27.5.1
- containerd: 1.7.24
- docker-init: 0.19.0
- Proxmox VE: 8.2.2
- LXC container: unprivileged with nesting=1, keyctl=1