Skip to content

runc init panics with SIGABRT (pathrs procfs handle invalid after fork) in docker/moby's TestNoNewPrivileges #5438

Description

@ricardobranco777

Description

runc init aborts with a Rust panic instead of completing normally. In docker/moby's integration test suite, TestNoNewPrivileges/CapabilityRequested=false runs /bin/cat under a no-new-privileges + reduced-capability config and expects exec /bin/cat: operation not permitted. Instead, runc init crashes with SIGABRT before it gets that far.

Note: Maybe related to #5437

Other package versions:
https://openqa.opensuse.org/tests/6196936/logfile?filename=docker_engine-rpm-qa.txt

Steps to reproduce the issue

From https://openqa.opensuse.org/tests/6196936/logfile?filename=docker_engine-commands.txt

### RUN AS root
zypper --gpg-auto-import-keys -n install --allow-vendor-change containerd-ctr distribution-registry docker docker-buildx docker-rootless-extras git glibc-devel go1.26 jq nftables-devel openssl qemu-linux-user rootlesskit selinux-tools skopeo xz
mv -f /etc/sysconfig/docker{,.bak} || true
mv -f /etc/docker/daemon.json{,.bak} || true
echo '{"min-api-version": "1.24"}' > /etc/docker/daemon.json
echo 'DOCKER_OPTS="-H unix:///var/run/docker.sock --insecure-registry localhost:5000 --log-level warn --registry-mirror http://3.126.238.126:5000 --experimental --selinux-enabled -H tcp://0.0.0.0:2375"' > /etc/sysconfig/docker
mkdir -p /etc/buildkit
systemctl restart docker
export DOCKER_HOST=tcp://localhost:2375
docker run --privileged --rm tonistiigi/binfmt --install all
cp /usr/sbin/containerd-ctr /usr/local/bin/ctr
ln -s /var/tmp/docker-frozen-images /
cd /var/tmp/
git clone --quiet --branch docker-v29.4.0 https://github.com/moby/moby.git
cd /var/tmp/moby
curl -sL --retry 9 --retry-delay 100 --retry-max-time 900 -O https://github.com/moby/moby/pull/51794.patch
git apply -3 --ours 51794.patch || git apply -3 --ours --include 'integration/*' 51794.patch
curl -sL --retry 9 --retry-delay 100 --retry-max-time 900 -O https://github.com/moby/moby/pull/51970.patch
git apply -3 --ours 51970.patch || git apply -3 --ours --include 'integration/*' 51970.patch
curl -sL --retry 9 --retry-delay 100 --retry-max-time 900 -O https://github.com/moby/moby/pull/51972.patch
git apply -3 --ours 51972.patch || git apply -3 --ours --include 'integration/*' 51972.patch
curl -sL --retry 9 --retry-delay 100 --retry-max-time 900 -O https://github.com/moby/moby/pull/52199.patch
git apply -3 --ours 52199.patch || git apply -3 --ours --include 'integration/*' 52199.patch
cp -f vendor.mod go.mod || true
cp -f vendor.sum go.sum || true
(cd testutil/fixtures/plugin/basic && go mod init docker-basic-plugin && go build -o $GOPATH/bin/docker-basic-plugin) || true
mkdir ~/.docker || true
echo {} > ~/.docker/config.json
contrib/download-frozen-image-v2.sh /var/tmp/docker-frozen-images busybox:latest@sha256:95cf004f559831017cdf4628aaf1bb30133677be8702a8c5f2994629f637a209 busybox:glibc@sha256:1f81263701cddf6402afe9f33fca0266d9fff379e59b1748f33d3072da71ee85 debian:trixie-slim@sha256:c85a2732e97694ea77237c61304b3bb410e0e961dd6ee945997a06c788c545bb hello-world:latest@sha256:d58e752213a51785838f9eed2b7a498ffa1cb3aa7f946dda11af39286c3db9a9 arm32v7/hello-world:latest@sha256:50b8560ad574c779908da71f7ce370c0a2471c098d44d1c8f6b513c5a55eeeb1 hello-world:amd64@sha256:90659bf80b44ce6be8234e6ff90a1ac34acbeb826903b02cfa0da11c82cbc042 hello-world:arm64@sha256:963612c5503f3f1674f315c67089dee577d8cc6afc18565e0b4183ae355fb343
mkdir -p /var/tmp/moby/bundles/tmp
pushd integration/build
timeout -k 3 900 env DOCKER_FIREWALL_BACKEND="iptables" DOCKER_INTEGRATION_DAEMON_DEST="/var/tmp/moby/bundles/tmp" DOCKER_ROOTLESS="" DOCKER_TEST_NO_FIREWALLD="true" TZ="UTC" gotestsum --junitfile integration-build.xml --format standard-verbose ./... -- -tags 'apparmor selinux seccomp pkcs11' |& tee -a /var/tmp/report.txt
popd
pushd integration/capabilities
timeout -k 3 900 env DOCKER_FIREWALL_BACKEND="iptables" DOCKER_INTEGRATION_DAEMON_DEST="/var/tmp/moby/bundles/tmp" DOCKER_ROOTLESS="" DOCKER_TEST_NO_FIREWALLD="true" TZ="UTC" gotestsum --junitfile integration-capabilities.xml --format standard-verbose ./... -- -tags 'apparmor selinux seccomp pkcs11' |& tee -a /var/tmp/report.txt
popd
pushd integration/config
timeout -k 3 900 env DOCKER_FIREWALL_BACKEND="iptables" DOCKER_INTEGRATION_DAEMON_DEST="/var/tmp/moby/bundles/tmp" DOCKER_ROOTLESS="" DOCKER_TEST_NO_FIREWALLD="true" TZ="UTC" gotestsum --junitfile integration-config.xml --format standard-verbose ./... -- -tags 'apparmor selinux seccomp pkcs11' |& tee -a /var/tmp/report.txt
popd
pushd integration/container
timeout -k 3 900 env DOCKER_FIREWALL_BACKEND="iptables" DOCKER_INTEGRATION_DAEMON_DEST="/var/tmp/moby/bundles/tmp" DOCKER_ROOTLESS="" DOCKER_TEST_NO_FIREWALLD="true" TZ="UTC" gotestsum --junitfile integration-container.xml --format standard-verbose ./... -- -tags 'apparmor selinux seccomp pkcs11' |& tee -a /var/tmp/report.txt
popd
pushd integration/daemon
timeout -k 3 900 env DOCKER_FIREWALL_BACKEND="iptables" DOCKER_INTEGRATION_DAEMON_DEST="/var/tmp/moby/bundles/tmp" DOCKER_ROOTLESS="" DOCKER_TEST_NO_FIREWALLD="true" TZ="UTC" gotestsum --junitfile integration-daemon.xml --format standard-verbose ./... -- -tags 'apparmor selinux seccomp pkcs11' |& tee -a /var/tmp/report.txt
popd
pushd integration/daemon/nri
timeout -k 3 900 env DOCKER_FIREWALL_BACKEND="iptables" DOCKER_INTEGRATION_DAEMON_DEST="/var/tmp/moby/bundles/tmp" DOCKER_ROOTLESS="" DOCKER_TEST_NO_FIREWALLD="true" TZ="UTC" gotestsum --junitfile integration-daemon-nri.xml --format standard-verbose ./... -- -tags 'apparmor selinux seccomp pkcs11' |& tee -a /var/tmp/report.txt
popd
pushd integration/image
timeout -k 3 900 env DOCKER_FIREWALL_BACKEND="iptables" DOCKER_INTEGRATION_DAEMON_DEST="/var/tmp/moby/bundles/tmp" DOCKER_ROOTLESS="" DOCKER_TEST_NO_FIREWALLD="true" TZ="UTC" gotestsum --junitfile integration-image.xml --format standard-verbose ./... -- -tags 'apparmor selinux seccomp pkcs11' |& tee -a /var/tmp/report.txt
popd
pushd integration/internal/termtest
timeout -k 3 900 env DOCKER_FIREWALL_BACKEND="iptables" DOCKER_INTEGRATION_DAEMON_DEST="/var/tmp/moby/bundles/tmp" DOCKER_ROOTLESS="" DOCKER_TEST_NO_FIREWALLD="true" TZ="UTC" gotestsum --junitfile integration-internal-termtest.xml --format standard-verbose ./... -- -tags 'apparmor selinux seccomp pkcs11' |& tee -a /var/tmp/report.txt
popd
pushd integration/secret
timeout -k 3 900 env DOCKER_FIREWALL_BACKEND="iptables" DOCKER_INTEGRATION_DAEMON_DEST="/var/tmp/moby/bundles/tmp" DOCKER_ROOTLESS="" DOCKER_TEST_NO_FIREWALLD="true" TZ="UTC" gotestsum --junitfile integration-secret.xml --format standard-verbose ./... -- -tags 'apparmor selinux seccomp pkcs11' |& tee -a /var/tmp/report.txt
popd
pushd integration/service
timeout -k 3 900 env DOCKER_FIREWALL_BACKEND="iptables" DOCKER_INTEGRATION_DAEMON_DEST="/var/tmp/moby/bundles/tmp" DOCKER_ROOTLESS="" DOCKER_TEST_NO_FIREWALLD="true" TZ="UTC" gotestsum --junitfile integration-service.xml --format standard-verbose ./... -- -tags 'apparmor selinux seccomp pkcs11' |& tee -a /var/tmp/report.txt
popd
pushd integration/session
timeout -k 3 900 env DOCKER_FIREWALL_BACKEND="iptables" DOCKER_INTEGRATION_DAEMON_DEST="/var/tmp/moby/bundles/tmp" DOCKER_ROOTLESS="" DOCKER_TEST_NO_FIREWALLD="true" TZ="UTC" gotestsum --junitfile integration-session.xml --format standard-verbose ./... -- -tags 'apparmor selinux seccomp pkcs11' |& tee -a /var/tmp/report.txt
popd
pushd integration/system
timeout -k 3 900 env DOCKER_FIREWALL_BACKEND="iptables" DOCKER_INTEGRATION_DAEMON_DEST="/var/tmp/moby/bundles/tmp" DOCKER_ROOTLESS="" DOCKER_TEST_NO_FIREWALLD="true" TZ="UTC" gotestsum --junitfile integration-system.xml --format standard-verbose ./... -- -tags 'apparmor selinux seccomp pkcs11' |& tee -a /var/tmp/report.txt
popd
pushd integration/volume
timeout -k 3 900 env DOCKER_FIREWALL_BACKEND="iptables" DOCKER_INTEGRATION_DAEMON_DEST="/var/tmp/moby/bundles/tmp" DOCKER_ROOTLESS="" DOCKER_TEST_NO_FIREWALLD="true" TZ="UTC" gotestsum --junitfile integration-volume.xml --format standard-verbose ./... -- -tags 'apparmor selinux seccomp pkcs11' |& tee -a /var/tmp/report.txt
popd

Describe the results you received and expected

From http://openqa-assets.opensuse.org/tests/6196936/file/docker_engine-integration-capabilities.xml

# Test messages # TestNoNewPrivileges/CapabilityRequested=false
# failure: 

Failed
=== RUN   TestNoNewPrivileges/CapabilityRequested=false
    capabilities_linux_test.go:99: test produced invalid error: "thread '<unnamed>' (1) panicked at src/procfs.rs:349:22:\ncached procfs handle should be valid: Error(Wrapped { context: \"check if candidate procfs root fd [9]<unknown> is a procfs root\", source: RawOsError { operation: \"fstatfs proc handle\", source: Fstatfs { fd: FrozenFd(9, None), source: Os { code: 9, kind: Uncategorized, message: \"Bad file descriptor\" } } } })\nnote: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\nSIGABRT: abort\nPC=0x7fa37589fef4 m=0 sigcode=18446744073709551610\nsignal arrived during cgo execution\n\ngoroutine 1 gp=0x2975826441e0 m=0 mp=0x563055b32c80 [syscall, locked to thread]:\nruntime.cgocall(0x563055667890, 0x29758279f3a0)\n\truntime/cgocall.go:167 +0x4b fp=0x29758279f378 sp=0x29758279f340 pc=0x5630552ba68b\ncyphar.com/go-pathrs/internal/libpathrs._Cfunc_pathrs_procfs_open(0x2975827e9090, 0x8)\n\t_cgo_gotypes.go:444 +0x4a fp=0x29758279f3a0 sp=0x29758279f378 pc=0x56305547782a\ncyphar.com/go-pathrs/internal/libpathrs.ProcfsOpen(0x20?)\n\tcyphar.com/go-pathrs@v0.2.5/internal/libpathrs/libpathrs_linux.go:335 +0x25 fp=0x29758279f3d0 sp=0x29758279f3a0 pc=0x563055478345\ncyphar.com/go-pathrs/procfs.Open({0x0, 0x0, 0x2975826441e0?})\n\tcyphar.com/go-pathrs@v0.2.5/procfs/procfs_linux.go:109 +0x78 fp=0x29758279f418 sp=0x29758279f3d0 pc=0x56305547a118\ngithub.com/cyphar/filepath-securejoin/pathrs-lite/procfs.OpenProcRoot(...)\n\tgithub.com/cyphar/filepath-securejoin@v0.7.0/pathrs-lite/procfs/procfs_libpathrs.go:54\ngithub.com/opencontainers/selinux/go-selinux.openProcThreadSelf({0x56305566a341, 0x9}, 0x80001)\n\tgithub.com/opencontainers/selinux@v1.13.1/go-selinux/selinux_linux.go:291 +0x74 fp=0x29758279f518 sp=0x29758279f418 pc=0x5630555434d4\ngithub.com/opencontainers/selinux/go-selinux.writeConThreadSelf({0x56305566a341?, 0x9?}, {0x0, 0x0})\n\tgithub.com/opencontainers/selinux@v1.13.1/go-selinux/selinux_linux.go:331 +0x69 fp=0x29758279f578 sp=0x29758279f518 pc=0x563055543a89\ngithub.com/opencontainers/selinux/go-selinux.SetExecLabel(...)\n\tgithub.com/opencontainers/selinux@v1.13.1/go-selinux/selinux.go:156\ngithub.com/opencontainers/runc/libcontainer.(*linuxStandardInit).Init.deferwrap2()\n\tgithub.com/opencontainers/runc/libcontainer/standard_init_linux.go:188 +0x25 fp=0x29758279f5a8 sp=0x29758279f578 pc=0x5630555acfa5\nruntime.deferreturn()\n\truntime/panic.go:668 +0x54 fp=0x29758279f630 sp=0x29758279f5a8 pc=0x563055281874\ngithub.com/opencontainers/runc/libcontainer.(*linuxStandardInit).Init(0x29758279f988)\n\tgithub.com/opencontainers/runc/libcontainer/standard_init_linux.go:306 +0x15f1 fp=0x29758279f948 sp=0x29758279f630 pc=0x5630555a2d51\ngithub.com/opencontainers/runc/libcontainer.containerInit({0x29758266a017, 0x8}, 0x297582700120, 0x297582671d08, 0x0, 0x0, 0x2975826420e8, 0x2975826420e0)\n\tgithub.com/opencontainers/runc/libcontainer/init_linux.go:266 +0x1ba fp=0x29758279f9f8 sp=0x29758279f948 pc=0x56305558b65a\ngithub.com/opencontainers/runc/libcontainer.startInitialization()\n\tgithub.com/opencontainers/runc/libcontainer/init_linux.go:238 +0xa1a fp=0x29758279fd40 sp=0x29758279f9f8 pc=0x56305558b43a\ngithub.com/opencontainers/runc/libcontainer.Init()\n\tgithub.com/opencontainers/runc/libcontainer/init_linux.go:110 +0x25 fp=0x29758279fd88 sp=0x29758279fd40 pc=0x56305558a9c5\nmain.init.0()\n\tgithub.com/opencontainers/runc/init.go:14 +0x33 fp=0x29758279fd98 sp=0x29758279fd88 pc=0x5630556424b3\nruntime.doInit1(0x563055b212f0)\n\truntime/proc.go:8154 +0xd7 fp=0x29758279feb8 sp=0x29758279fd98 pc=0x563055294557\nruntime.doInit(...)\n\truntime/proc.go:8121\nruntime.main()\n\truntime/proc.go:269 +0x3b0 fp=0x29758279ffe0 sp=0x29758279feb8 pc=0x563055285c70\nruntime.goexit({})\n\truntime/asm_amd64.s:1264 +0x1 fp=0x29758279ffe8 sp=0x29758279ffe0 pc=0x5630552c4bc1\n\ngoroutine 2 gp=0x297582644d20 m=nil [force gc (idle)]:\nruntime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)\n\truntime/proc.go:474 +0xca fp=0x29758268afa8 sp=0x29758268af88 pc=0x5630552bda2a\nruntime.goparkunlock(...)\n\truntime/proc.go:480\nruntime.forcegchelper()\n\truntime/proc.go:387 +0xb8 fp=0x29758268afe0 sp=0x29758268afa8 pc=0x563055285fb8\nruntime.goexit({})\n\truntime/asm_amd64.s:1264 +0x1 fp=0x29758268afe8 sp=0x29758268afe0 pc=0x5630552c4bc1\ncreated by runtime.init.7 in goroutine 1\n\truntime/proc.go:375 +0x1a\n\ngoroutine 3 gp=0x2975826452c0 m=nil [GC sweep wait]:\nruntime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)\n\truntime/proc.go:474 +0xca fp=0x29758268b788 sp=0x29758268b768 pc=0x5630552bda2a\nruntime.goparkunlock(...)\n\truntime/proc.go:480\nruntime.bgsweep(0x2975826b2000)\n\truntime/mgcsweep.go:279 +0x94 fp=0x29758268b7c8 sp=0x29758268b788 pc=0x5630552709b4\nruntime.gcenable.gowrap1()\n\truntime/mgc.go:214 +0x17 fp=0x29758268b7e0 sp=0x29758268b7c8 pc=0x5630552b3e77\nruntime.goexit({})\n\truntime/asm_amd64.s:1264 +0x1 fp=0x29758268b7e8 sp=0x29758268b7e0 pc=0x5630552c4bc1\ncreated by runtime.gcenable in goroutine 1\n\truntime/mgc.go:214 +0x66\n\ngoroutine 4 gp=0x2975826454a0 m=nil [GC scavenge wait]:\nruntime.gopark(0x2975826b2000?, 0x5630556949d8?, 0x1?, 0x0?, 0x2975826454a0?)\n\truntime/proc.go:474 +0xca fp=0x29758268bf78 sp=0x29758268bf58 pc=0x5630552bda2a\nruntime.goparkunlock(...)\n\truntime/proc.go:480\nruntime.(*scavengerState).park(0x563055b318e0)\n\truntime/mgcscavenge.go:425 +0x49 fp=0x29758268bfa8 sp=0x29758268bf78 pc=0x56305526e589\nruntime.bgscavenge(0x2975826b2000)\n\truntime/mgcscavenge.go:653 +0x3c fp=0x29758268bfc8 sp=0x29758268bfa8 pc=0x56305526eadc\nruntime.gcenable.gowrap2()\n\truntime/mgc.go:215 +0x17 fp=0x29758268bfe0 sp=0x29758268bfc8 pc=0x5630552b3e37\nruntime.goexit({})\n\truntime/asm_amd64.s:1264 +0x1 fp=0x29758268bfe8 sp=0x29758268bfe0 pc=0x5630552c4bc1\ncreated by runtime.gcenable in goroutine 1\n\truntime/mgc.go:215 +0xa5\n\ngoroutine 5 gp=0x297582645a40 m=nil [GOMAXPROCS updater (idle)]:\nruntime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)\n\truntime/proc.go:474 +0xca fp=0x29758268c788 sp=0x29758268c768 pc=0x5630552bda2a\nruntime.goparkunlock(...)\n\truntime/proc.go:480\nruntime.updateMaxProcsGoroutine()\n\truntime/proc.go:7146 +0xe7 fp=0x29758268c7e0 sp=0x29758268c788 pc=0x5630552934e7\nruntime.goexit({})\n\truntime/asm_amd64.s:1264 +0x1 fp=0x29758268c7e8 sp=0x29758268c7e0 pc=0x5630552c4bc1\ncreated by runtime.defaultGOMAXPROCSUpdateEnable in goroutine 1\n\truntime/proc.go:7134 +0x37\n\ngoroutine 6 gp=0x2975826cc1e0 m=nil [finalizer wait]:\nruntime.gopark(0x2975826441e0?, 0x563000000000?, 0x0?, 0xc0?, 0x2975826c2088?)\n\truntime/proc.go:474 +0xca fp=0x29758268a620 sp=0x29758268a600 pc=0x5630552bda2a\nruntime.runFinalizers()\n\truntime/mfinal.go:210 +0x107 fp=0x29758268a7e0 sp=0x29758268a620 pc=0x5630552619e7\nruntime.goexit({})\n\truntime/asm_amd64.s:1264 +0x1 fp=0x29758268a7e8 sp=0x29758268a7e0 pc=0x5630552c4bc1\ncreated by runtime.createfing in goroutine 1\n\truntime/mfinal.go:172 +0x3d\n\ngoroutine 7 gp=0x2975826cc3c0 m=nil [cleanup wait]:\nruntime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)\n\truntime/proc.go:474 +0xca fp=0x29758268cf68 sp=0x29758268cf48 pc=0x5630552bda2a\nruntime.goparkunlock(...)\n\truntime/proc.go:480\nruntime.(*cleanupQueue).dequeue(0x563055b31b80)\n\truntime/mcleanup.go:522 +0xd3 fp=0x29758268cfa0 sp=0x29758268cf68 pc=0x56305525e6d3\nruntime.runCleanups()\n\truntime/mcleanup.go:718 +0x45 fp=0x29758268cfe0 sp=0x29758268cfa0 pc=0x56305525ed45\nruntime.goexit({})\n\truntime/asm_amd64.s:1264 +0x1 fp=0x29758268cfe8 sp=0x29758268cfe0 pc=0x5630552c4bc1\ncreated by runtime.(*cleanupQueue).createGs in goroutine 1\n\truntime/mcleanup.go:672 +0xa5\n\nrax    0x0\nrbx    0x1\nrcx    0x7fa37589fef4\nrdx    0x6\nrdi    0x1\nrsi    0x1\nrbp    0x7ffcd9aa9a30\nrsp    0x7ffcd9aa9920\nr8     0x0\nr9     0x0\nr10    0x0\nr11    0x246\nr12    0x7ffcd9aa9a88\nr13    0x7fa375b51780\nr14    0x6\nr15    0x2\nrip    0x7fa37589fef4\nrflags 0x246\ncs     0x33\nfs     0x0\ngs     0x0", expected "exec /bin/cat: operation not permitted". Stdout:""
--- FAIL: TestNoNewPrivileges/CapabilityRequested=false (0.24s)

moby test that fails:
https://github.com/moby/moby/blob/docker-v29.4.0/integration/capabilities/capabilities_linux_test.go#L19

What version of runc are you using?

runc version 1.5.1
commit: v1.5.1-0-g8f2685a4
spec: 1.3.0
go: go1.27.0
libseccomp: 2.6.1
libpathrs: 0.2.5

Host OS information

openSUSE Tumbleweed Build20260831 snapshot (unreleased)

Host kernel information

Linux susetest 7.2.2-1-default #1 SMP PREEMPT_DYNAMIC Fri Aug 28 06:56:48 UTC 2026 (93c77bd) x86_64 x86_64 x86_64 GNU/Linux

Activity

  1. ricardobranco777 commented on Sep 1, 2026

    @ricardobranco777
    ContributorAuthor

    Got a minimal reproducer. As root:

    mkdir /tmp/captest && cd /tmp/captest
    cat <<'EOF' > Dockerfile
    FROM debian:trixie-slim
    RUN apt-get update && apt-get install -y libcap2-bin --no-install-recommends
    RUN setcap CAP_DAC_OVERRIDE=+eip /bin/cat
    RUN echo "hello" > /txt && chown 0:0 /txt && chmod 700 /txt
    RUN useradd -u 1500 test
    EOF
    
    docker build -t captest .
    
    docker run --rm  --user test  --cap-drop=CAP_DAC_OVERRIDE --security-opt no-new-privileges=true captest /bin/cat /txt
    

    Got:

    thread '<unnamed>' (1) panicked at src/procfs.rs:349:22:
    cached procfs handle should be valid: Error(Wrapped { context: "check if candidate procfs root fd [9]<unknown> is a procfs root", source: RawOsError { operation: "fstatfs proc handle", source: Fstatfs { fd: FrozenFd(9, None), source: Os { code: 9, kind: Uncategorized, message: "Bad file descriptor" } } } })
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    SIGABRT: abort
    PC=0x7ffb4569fef4 m=0 sigcode=18446744073709551610
    signal arrived during cgo execution
    
    goroutine 1 gp=0xff4b95841e0 m=0 mp=0x561af3495c80 [syscall, locked to thread]:
    runtime.cgocall(0x561af2fca890, 0xff4b971f3a0)
            runtime/cgocall.go:167 +0x4b fp=0xff4b971f378 sp=0xff4b971f340 pc=0x561af2c1d68b
    cyphar.com/go-pathrs/internal/libpathrs._Cfunc_pathrs_procfs_open(0xff4b967d080, 0x8)
            _cgo_gotypes.go:444 +0x4a fp=0xff4b971f3a0 sp=0xff4b971f378 pc=0x561af2dda82a
    cyphar.com/go-pathrs/internal/libpathrs.ProcfsOpen(0x20?)
            cyphar.com/go-pathrs@v0.2.5/internal/libpathrs/libpathrs_linux.go:335 +0x25 fp=0xff4b971f3d0 sp=0xff4b971f3a0 pc=0x561af2ddb345
    cyphar.com/go-pathrs/procfs.Open({0x0, 0x0, 0xff4b95841e0?})
            cyphar.com/go-pathrs@v0.2.5/procfs/procfs_linux.go:109 +0x78 fp=0xff4b971f418 sp=0xff4b971f3d0 pc=0x561af2ddd118
    github.com/cyphar/filepath-securejoin/pathrs-lite/procfs.OpenProcRoot(...)
            github.com/cyphar/filepath-securejoin@v0.7.0/pathrs-lite/procfs/procfs_libpathrs.go:54
    github.com/opencontainers/selinux/go-selinux.openProcThreadSelf({0x561af2fcd341, 0x9}, 0x80001)
            github.com/opencontainers/selinux@v1.13.1/go-selinux/selinux_linux.go:291 +0x74 fp=0xff4b971f518 sp=0xff4b971f418 pc=0x561af2ea64d4
    github.com/opencontainers/selinux/go-selinux.writeConThreadSelf({0x561af2fcd341?, 0x9?}, {0x0, 0x0})
            github.com/opencontainers/selinux@v1.13.1/go-selinux/selinux_linux.go:331 +0x69 fp=0xff4b971f578 sp=0xff4b971f518 pc=0x561af2ea6a89
    github.com/opencontainers/selinux/go-selinux.SetExecLabel(...)
            github.com/opencontainers/selinux@v1.13.1/go-selinux/selinux.go:156
    github.com/opencontainers/runc/libcontainer.(*linuxStandardInit).Init.deferwrap2()
            github.com/opencontainers/runc/libcontainer/standard_init_linux.go:188 +0x25 fp=0xff4b971f5a8 sp=0xff4b971f578 pc=0x561af2f0ffa5
    runtime.deferreturn()
            runtime/panic.go:668 +0x54 fp=0xff4b971f630 sp=0xff4b971f5a8 pc=0x561af2be4874
    github.com/opencontainers/runc/libcontainer.(*linuxStandardInit).Init(0xff4b971f988)
            github.com/opencontainers/runc/libcontainer/standard_init_linux.go:306 +0x15f1 fp=0xff4b971f948 sp=0xff4b971f630 pc=0x561af2f05d51
    github.com/opencontainers/runc/libcontainer.containerInit({0xff4b95aa017, 0x8}, 0xff4b96c0120, 0xff4b95b1d08, 0x0, 0x0, 0xff4b95820e8, 0xff4b95820e0)
            github.com/opencontainers/runc/libcontainer/init_linux.go:266 +0x1ba fp=0xff4b971f9f8 sp=0xff4b971f948 pc=0x561af2eee65a
    github.com/opencontainers/runc/libcontainer.startInitialization()
            github.com/opencontainers/runc/libcontainer/init_linux.go:238 +0xa1a fp=0xff4b971fd40 sp=0xff4b971f9f8 pc=0x561af2eee43a
    github.com/opencontainers/runc/libcontainer.Init()
            github.com/opencontainers/runc/libcontainer/init_linux.go:110 +0x25 fp=0xff4b971fd88 sp=0xff4b971fd40 pc=0x561af2eed9c5
    main.init.0()
            github.com/opencontainers/runc/init.go:14 +0x33 fp=0xff4b971fd98 sp=0xff4b971fd88 pc=0x561af2fa54b3
    runtime.doInit1(0x561af34842f0)
            runtime/proc.go:8154 +0xd7 fp=0xff4b971feb8 sp=0xff4b971fd98 pc=0x561af2bf7557
    runtime.doInit(...)
            runtime/proc.go:8121
    runtime.main()
            runtime/proc.go:269 +0x3b0 fp=0xff4b971ffe0 sp=0xff4b971feb8 pc=0x561af2be8c70
    runtime.goexit({})
            runtime/asm_amd64.s:1264 +0x1 fp=0xff4b971ffe8 sp=0xff4b971ffe0 pc=0x561af2c27bc1
    
    goroutine 2 gp=0xff4b9584d20 m=nil [force gc (idle)]:
    runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
            runtime/proc.go:474 +0xca fp=0xff4b95cafa8 sp=0xff4b95caf88 pc=0x561af2c20a2a
    runtime.goparkunlock(...)
            runtime/proc.go:480
    runtime.forcegchelper()
            runtime/proc.go:387 +0xb8 fp=0xff4b95cafe0 sp=0xff4b95cafa8 pc=0x561af2be8fb8
    runtime.goexit({})
            runtime/asm_amd64.s:1264 +0x1 fp=0xff4b95cafe8 sp=0xff4b95cafe0 pc=0x561af2c27bc1
    created by runtime.init.7 in goroutine 1
            runtime/proc.go:375 +0x1a
    
    goroutine 3 gp=0xff4b95852c0 m=nil [GC sweep wait]:
    runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
            runtime/proc.go:474 +0xca fp=0xff4b95cb788 sp=0xff4b95cb768 pc=0x561af2c20a2a
    runtime.goparkunlock(...)
            runtime/proc.go:480
    runtime.bgsweep(0xff4b95f2000)
            runtime/mgcsweep.go:279 +0x94 fp=0xff4b95cb7c8 sp=0xff4b95cb788 pc=0x561af2bd39b4
    runtime.gcenable.gowrap1()
            runtime/mgc.go:214 +0x17 fp=0xff4b95cb7e0 sp=0xff4b95cb7c8 pc=0x561af2c16e77
    runtime.goexit({})
            runtime/asm_amd64.s:1264 +0x1 fp=0xff4b95cb7e8 sp=0xff4b95cb7e0 pc=0x561af2c27bc1
    created by runtime.gcenable in goroutine 1
            runtime/mgc.go:214 +0x66
    
    goroutine 4 gp=0xff4b95854a0 m=nil [GC scavenge wait]:
    runtime.gopark(0xff4b95f2000?, 0x561af2ff79d8?, 0x1?, 0x0?, 0xff4b95854a0?)
            runtime/proc.go:474 +0xca fp=0xff4b95cbf78 sp=0xff4b95cbf58 pc=0x561af2c20a2a
    runtime.goparkunlock(...)
            runtime/proc.go:480
    runtime.(*scavengerState).park(0x561af34948e0)
            runtime/mgcscavenge.go:425 +0x49 fp=0xff4b95cbfa8 sp=0xff4b95cbf78 pc=0x561af2bd1589
    runtime.bgscavenge(0xff4b95f2000)
            runtime/mgcscavenge.go:653 +0x3c fp=0xff4b95cbfc8 sp=0xff4b95cbfa8 pc=0x561af2bd1adc
    runtime.gcenable.gowrap2()
            runtime/mgc.go:215 +0x17 fp=0xff4b95cbfe0 sp=0xff4b95cbfc8 pc=0x561af2c16e37
    runtime.goexit({})
            runtime/asm_amd64.s:1264 +0x1 fp=0xff4b95cbfe8 sp=0xff4b95cbfe0 pc=0x561af2c27bc1
    created by runtime.gcenable in goroutine 1
            runtime/mgc.go:215 +0xa5
    
    goroutine 5 gp=0xff4b9585a40 m=nil [GOMAXPROCS updater (idle)]:
    runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
            runtime/proc.go:474 +0xca fp=0xff4b95cc788 sp=0xff4b95cc768 pc=0x561af2c20a2a
    runtime.goparkunlock(...)
            runtime/proc.go:480
    runtime.updateMaxProcsGoroutine()
            runtime/proc.go:7146 +0xe7 fp=0xff4b95cc7e0 sp=0xff4b95cc788 pc=0x561af2bf64e7
    runtime.goexit({})
            runtime/asm_amd64.s:1264 +0x1 fp=0xff4b95cc7e8 sp=0xff4b95cc7e0 pc=0x561af2c27bc1
    created by runtime.defaultGOMAXPROCSUpdateEnable in goroutine 1
            runtime/proc.go:7134 +0x37
    
    goroutine 6 gp=0xff4b968c1e0 m=nil [finalizer wait]:
    runtime.gopark(0xff4b95841e0?, 0x561a00000000?, 0x0?, 0xc0?, 0xff4b9682088?)
            runtime/proc.go:474 +0xca fp=0xff4b95ca620 sp=0xff4b95ca600 pc=0x561af2c20a2a
    runtime.runFinalizers()
            runtime/mfinal.go:210 +0x107 fp=0xff4b95ca7e0 sp=0xff4b95ca620 pc=0x561af2bc49e7
    runtime.goexit({})
            runtime/asm_amd64.s:1264 +0x1 fp=0xff4b95ca7e8 sp=0xff4b95ca7e0 pc=0x561af2c27bc1
    created by runtime.createfing in goroutine 1
            runtime/mfinal.go:172 +0x3d
    
    goroutine 7 gp=0xff4b968c3c0 m=nil [cleanup wait]:
    runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
            runtime/proc.go:474 +0xca fp=0xff4b95ccf68 sp=0xff4b95ccf48 pc=0x561af2c20a2a
    runtime.goparkunlock(...)
            runtime/proc.go:480
    runtime.(*cleanupQueue).dequeue(0x561af3494b80)
            runtime/mcleanup.go:522 +0xd3 fp=0xff4b95ccfa0 sp=0xff4b95ccf68 pc=0x561af2bc16d3
    runtime.runCleanups()
            runtime/mcleanup.go:718 +0x45 fp=0xff4b95ccfe0 sp=0xff4b95ccfa0 pc=0x561af2bc1d45
    runtime.goexit({})
            runtime/asm_amd64.s:1264 +0x1 fp=0xff4b95ccfe8 sp=0xff4b95ccfe0 pc=0x561af2c27bc1
    created by runtime.(*cleanupQueue).createGs in goroutine 1
            runtime/mcleanup.go:672 +0xa5
    
    rax    0x0
    rbx    0x1
    rcx    0x7ffb4569fef4
    rdx    0x6
    rdi    0x1
    rsi    0x1
    rbp    0x7fffa40c16d0
    rsp    0x7fffa40c15c0
    r8     0x0
    r9     0x0
    r10    0x0
    r11    0x246
    r12    0x7fffa40c1728
    r13    0x7ffb458d4780
    r14    0x6
    r15    0x2
    rip    0x7ffb4569fef4
    rflags 0x246
    cs     0x33
    fs     0x0
    gs     0x0
    
  2. ricardobranco777 commented on Sep 1, 2026

    @ricardobranco777
    ContributorAuthor

    Got a minimal runc reproducer that can be eventually added to the bats tests:

    mkdir -p /tmp/runc-repro/rootfs/bin
    cd /tmp/runc-repro
    curl -sLo rootfs/bin/busybox https://busybox.net/downloads/binaries/1.37.0-x86_64-linux-musl/busybox
    chmod +x rootfs/bin/busybox
    ln -s busybox rootfs/bin/true
    runc spec
    jq '
        .process += {
          terminal: false,
          args: ["/bin/true"],
          selinuxLabel: "system_u:system_r:container_t:s0:c144,c449"
        } |
        .linux += {
          mountLabel: "system_u:object_r:container_file_t:s0:c144,c449"
        }
      ' config.json > config.json.new && mv config.json.new config.json
    runc run reprotest
    

    Got:

    thread '<unnamed>' (1) panicked at src/procfs.rs:349:22:
    cached procfs handle should be valid: Error(Wrapped { context: "check if candidate procfs root fd [9]<unknown> is a procfs root", source: RawOsError { operation: "fstatfs proc handle", source: Fstatfs { fd: FrozenFd(9, None), source: Os { code: 9, kind: Uncategorized, message: "Bad file descriptor" } } } })
    note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
    SIGABRT: abort
    PC=0x7fe3e5e9fef4 m=0 sigcode=18446744073709551610
    signal arrived during cgo execution
    
    goroutine 1 gp=0x276c19f01e0 m=0 mp=0x5583b29e9c80 [syscall, locked to thread]:
    runtime.cgocall(0x5583b251e890, 0x276c1b9f3a0)
            runtime/cgocall.go:167 +0x4b fp=0x276c1b9f378 sp=0x276c1b9f340 pc=0x5583b217168b
    cyphar.com/go-pathrs/internal/libpathrs._Cfunc_pathrs_procfs_open(0x276c1abc300, 0x8)
            _cgo_gotypes.go:444 +0x4a fp=0x276c1b9f3a0 sp=0x276c1b9f378 pc=0x5583b232e82a
    cyphar.com/go-pathrs/internal/libpathrs.ProcfsOpen(0x20?)
            cyphar.com/go-pathrs@v0.2.5/internal/libpathrs/libpathrs_linux.go:335 +0x25 fp=0x276c1b9f3d0 sp=0x276c1b9f3a0 pc=0x5583b232f345
    cyphar.com/go-pathrs/procfs.Open({0x0, 0x0, 0x276c19f01e0?})
            cyphar.com/go-pathrs@v0.2.5/procfs/procfs_linux.go:109 +0x78 fp=0x276c1b9f418 sp=0x276c1b9f3d0 pc=0x5583b2331118
    github.com/cyphar/filepath-securejoin/pathrs-lite/procfs.OpenProcRoot(...)
            github.com/cyphar/filepath-securejoin@v0.7.0/pathrs-lite/procfs/procfs_libpathrs.go:54
    github.com/opencontainers/selinux/go-selinux.openProcThreadSelf({0x5583b2521341, 0x9}, 0x80001)
            github.com/opencontainers/selinux@v1.13.1/go-selinux/selinux_linux.go:291 +0x74 fp=0x276c1b9f518 sp=0x276c1b9f418 pc=0x5583b23fa4d4
    github.com/opencontainers/selinux/go-selinux.writeConThreadSelf({0x5583b2521341?, 0x9?}, {0x0, 0x0})
            github.com/opencontainers/selinux@v1.13.1/go-selinux/selinux_linux.go:331 +0x69 fp=0x276c1b9f578 sp=0x276c1b9f518 pc=0x5583b23faa89
    github.com/opencontainers/selinux/go-selinux.SetExecLabel(...)
            github.com/opencontainers/selinux@v1.13.1/go-selinux/selinux.go:156
    github.com/opencontainers/runc/libcontainer.(*linuxStandardInit).Init.deferwrap2()
            github.com/opencontainers/runc/libcontainer/standard_init_linux.go:188 +0x25 fp=0x276c1b9f5a8 sp=0x276c1b9f578 pc=0x5583b2463fa5
    runtime.deferreturn()
            runtime/panic.go:668 +0x54 fp=0x276c1b9f630 sp=0x276c1b9f5a8 pc=0x5583b2138874
    github.com/opencontainers/runc/libcontainer.(*linuxStandardInit).Init(0x276c1b9f988)
            github.com/opencontainers/runc/libcontainer/standard_init_linux.go:306 +0x15f1 fp=0x276c1b9f948 sp=0x276c1b9f630 pc=0x5583b2459d51
    github.com/opencontainers/runc/libcontainer.containerInit({0x276c1a16017, 0x8}, 0x276c1b3c120, 0x276c1a1dd08, 0x0, 0x0, 0x276c19ee0e8, 0x276c19ee0e0)
            github.com/opencontainers/runc/libcontainer/init_linux.go:266 +0x1ba fp=0x276c1b9f9f8 sp=0x276c1b9f948 pc=0x5583b244265a
    github.com/opencontainers/runc/libcontainer.startInitialization()
            github.com/opencontainers/runc/libcontainer/init_linux.go:238 +0xa1a fp=0x276c1b9fd40 sp=0x276c1b9f9f8 pc=0x5583b244243a
    github.com/opencontainers/runc/libcontainer.Init()
            github.com/opencontainers/runc/libcontainer/init_linux.go:110 +0x25 fp=0x276c1b9fd88 sp=0x276c1b9fd40 pc=0x5583b24419c5
    main.init.0()
            github.com/opencontainers/runc/init.go:14 +0x33 fp=0x276c1b9fd98 sp=0x276c1b9fd88 pc=0x5583b24f94b3
    runtime.doInit1(0x5583b29d82f0)
            runtime/proc.go:8154 +0xd7 fp=0x276c1b9feb8 sp=0x276c1b9fd98 pc=0x5583b214b557
    runtime.doInit(...)
            runtime/proc.go:8121
    runtime.main()
            runtime/proc.go:269 +0x3b0 fp=0x276c1b9ffe0 sp=0x276c1b9feb8 pc=0x5583b213cc70
    runtime.goexit({})
            runtime/asm_amd64.s:1264 +0x1 fp=0x276c1b9ffe8 sp=0x276c1b9ffe0 pc=0x5583b217bbc1
    
    goroutine 2 gp=0x276c19f0d20 m=nil [force gc (idle)]:
    runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
            runtime/proc.go:474 +0xca fp=0x276c1a48fa8 sp=0x276c1a48f88 pc=0x5583b2174a2a
    runtime.goparkunlock(...)
            runtime/proc.go:480
    runtime.forcegchelper()
            runtime/proc.go:387 +0xb8 fp=0x276c1a48fe0 sp=0x276c1a48fa8 pc=0x5583b213cfb8
    runtime.goexit({})
            runtime/asm_amd64.s:1264 +0x1 fp=0x276c1a48fe8 sp=0x276c1a48fe0 pc=0x5583b217bbc1
    created by runtime.init.7 in goroutine 1
            runtime/proc.go:375 +0x1a
    
    goroutine 3 gp=0x276c19f12c0 m=nil [GC sweep wait]:
    runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
            runtime/proc.go:474 +0xca fp=0x276c1a49788 sp=0x276c1a49768 pc=0x5583b2174a2a
    runtime.goparkunlock(...)
            runtime/proc.go:480
    runtime.bgsweep(0x276c1a70000)
            runtime/mgcsweep.go:279 +0x94 fp=0x276c1a497c8 sp=0x276c1a49788 pc=0x5583b21279b4
    runtime.gcenable.gowrap1()
            runtime/mgc.go:214 +0x17 fp=0x276c1a497e0 sp=0x276c1a497c8 pc=0x5583b216ae77
    runtime.goexit({})
            runtime/asm_amd64.s:1264 +0x1 fp=0x276c1a497e8 sp=0x276c1a497e0 pc=0x5583b217bbc1
    created by runtime.gcenable in goroutine 1
            runtime/mgc.go:214 +0x66
    
    goroutine 4 gp=0x276c19f14a0 m=nil [GC scavenge wait]:
    runtime.gopark(0x276c1a70000?, 0x5583b254b9d8?, 0x1?, 0x0?, 0x276c19f14a0?)
            runtime/proc.go:474 +0xca fp=0x276c1a49f78 sp=0x276c1a49f58 pc=0x5583b2174a2a
    runtime.goparkunlock(...)
            runtime/proc.go:480
    runtime.(*scavengerState).park(0x5583b29e88e0)
            runtime/mgcscavenge.go:425 +0x49 fp=0x276c1a49fa8 sp=0x276c1a49f78 pc=0x5583b2125589
    runtime.bgscavenge(0x276c1a70000)
            runtime/mgcscavenge.go:653 +0x3c fp=0x276c1a49fc8 sp=0x276c1a49fa8 pc=0x5583b2125adc
    runtime.gcenable.gowrap2()
            runtime/mgc.go:215 +0x17 fp=0x276c1a49fe0 sp=0x276c1a49fc8 pc=0x5583b216ae37
    runtime.goexit({})
            runtime/asm_amd64.s:1264 +0x1 fp=0x276c1a49fe8 sp=0x276c1a49fe0 pc=0x5583b217bbc1
    created by runtime.gcenable in goroutine 1
            runtime/mgc.go:215 +0xa5
    
    goroutine 5 gp=0x276c19f1a40 m=nil [GOMAXPROCS updater (idle)]:
    runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
            runtime/proc.go:474 +0xca fp=0x276c1a4a788 sp=0x276c1a4a768 pc=0x5583b2174a2a
    runtime.goparkunlock(...)
            runtime/proc.go:480
    runtime.updateMaxProcsGoroutine()
            runtime/proc.go:7146 +0xe7 fp=0x276c1a4a7e0 sp=0x276c1a4a788 pc=0x5583b214a4e7
    runtime.goexit({})
            runtime/asm_amd64.s:1264 +0x1 fp=0x276c1a4a7e8 sp=0x276c1a4a7e0 pc=0x5583b217bbc1
    created by runtime.defaultGOMAXPROCSUpdateEnable in goroutine 1
            runtime/proc.go:7134 +0x37
    
    goroutine 6 gp=0x276c1b081e0 m=nil [finalizer wait]:
    runtime.gopark(0x276c19f01e0?, 0x558300000000?, 0x0?, 0x80?, 0x276c1a7e088?)
            runtime/proc.go:474 +0xca fp=0x276c1a48620 sp=0x276c1a48600 pc=0x5583b2174a2a
    runtime.runFinalizers()
            runtime/mfinal.go:210 +0x107 fp=0x276c1a487e0 sp=0x276c1a48620 pc=0x5583b21189e7
    runtime.goexit({})
            runtime/asm_amd64.s:1264 +0x1 fp=0x276c1a487e8 sp=0x276c1a487e0 pc=0x5583b217bbc1
    created by runtime.createfing in goroutine 1
            runtime/mfinal.go:172 +0x3d
    
    goroutine 7 gp=0x276c1b083c0 m=nil [cleanup wait]:
    runtime.gopark(0x0?, 0x0?, 0x0?, 0x0?, 0x0?)
            runtime/proc.go:474 +0xca fp=0x276c1a4af68 sp=0x276c1a4af48 pc=0x5583b2174a2a
    runtime.goparkunlock(...)
            runtime/proc.go:480
    runtime.(*cleanupQueue).dequeue(0x5583b29e8b80)
            runtime/mcleanup.go:522 +0xd3 fp=0x276c1a4afa0 sp=0x276c1a4af68 pc=0x5583b21156d3
    runtime.runCleanups()
            runtime/mcleanup.go:718 +0x45 fp=0x276c1a4afe0 sp=0x276c1a4afa0 pc=0x5583b2115d45
    runtime.goexit({})
            runtime/asm_amd64.s:1264 +0x1 fp=0x276c1a4afe8 sp=0x276c1a4afe0 pc=0x5583b217bbc1
    created by runtime.(*cleanupQueue).createGs in goroutine 1
            runtime/mcleanup.go:672 +0xa5
    
    rax    0x0
    rbx    0x1
    rcx    0x7fe3e5e9fef4
    rdx    0x6
    rdi    0x1
    rsi    0x1
    rbp    0x7fff67ac56c0
    rsp    0x7fff67ac55b0
    r8     0x0
    r9     0x0
    r10    0x0
    r11    0x246
    r12    0x7fff67ac5718
    r13    0x7fe3e6012780
    r14    0x6
    r15    0x2
    rip    0x7fe3e5e9fef4
    rflags 0x246
    cs     0x33
    fs     0x0
    gs     0x0
    
  3. saschagrunert commented on Sep 1, 2026

    @saschagrunert
    Contributor

    We're seeing the same root cause in cri-tools CI with CRI-O on Ubuntu 24.04 (GitHub Actions), manifesting through the AppArmor code path rather than SELinux.

    With runc v1.5.1 (libpathrs v0.2.5), 14 critest failures occur across mount propagation, readonly mounts, privileged containers, and host-namespace tests. Reverting to runc v1.4.3 (libpathrs v0.2.4) makes all tests pass.

    The AppArmor error is:

    runc create failed: unable to start container process: error during container init:
      unable to apply apparmor profile: apparmor failed to apply profile:
      write /7/task/7/attr/apparmor/exec: no such file or directory
    

    AppArmor is just one trigger. The same CI run also shows failures in mount propagation, readonly mounts, privileged containers, host namespaces, seccomp, and OOM detection, all of which go through the same procfs handle after fork.

    The path /7/task/7/attr/apparmor/exec (instead of /proc/thread-self/attr/apparmor/exec) confirms the cached procfs handle is invalid after fork. Both the AppArmor path (apparmor.applyProfile -> ProcThreadSelfOpen) and the SELinux path (selinux.SetExecLabel -> openProcThreadSelf) converge on procfs.OpenProcRoot() -> libpathrs.ProcfsOpen(), so this is the same bug.

    CI run: https://github.com/kubernetes-sigs/cri-tools/actions/runs/33514704070
    Reproducer PR: kubernetes-sigs/cri-tools#2176

  4. added this to the 1.5.2 milestone on Sep 2, 2026
  5. kolyshkin commented on Sep 2, 2026

    @kolyshkin
    Contributor

    OK we have two bugs here. First one is selinux and the fix is incoming.

    @saschagrunert second one is probably not apparmor related: what you see here is a correctly working test ("should fail with an unloaded apparmor_profile") which prints a bad path in the (correct) error message (no "/proc" prefix). Note that the error is "write" meaning we've already opened the file successfully and write(fd, ...) returns ENOENT (which is a way for the kernel to say "no profile loaded").

    I will open a separate bug for this one.

  6. added 2 commits that reference this issue on Sep 2, 2026
    b4ca194
    1056e68
  7. added a commit that references this issue on Sep 4, 2026
    f263f05
  8. cyphar commented on Sep 13, 2026

    @cyphar
    Member

    FYI, cyphar/libpathrs#413 also fixes the issue in a more comprehensive way (removing the problematic panic entirely).

  9. ricardobranco777 commented on Sep 17, 2026

    @ricardobranco777
    ContributorAuthor

    runc v1.5.1 with the patched libpathrs now works on Tumbleweed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions