runc accepts a pre-existing file or different device at a requested device path
Description
Both candidates successfully create a container although /data/conflict already exists as either a regular file or character device 1:5, while linux.devices requests character device 1:3. Each paired valid control passes. The rejection scenario stops after unexpected acceptance at create; it does not claim the candidate program ran.
This report uses OCI Runtime Specification v1.3.0. The historical failure was also observed in the saved failure retest. The attached runc-conflicting-device-path-reproducer.tar.gz contains the exact case inputs, framework sources and recorded evidence. The exported entry point has only been checked statically, not executed.
Steps to reproduce the issue
OCI explicitly requires an error when an existing file does not match the requested device. /data/conflict is outside the separately mounted /dev, so the conflicting inode is not hidden by that mount.
Steps to reproduce the issue
Use Linux/WSL2 as root with Python 3, a native C compiler/static libc, and a built runtime. The selected cases declare additional host prerequisites in case.json (for example iproute2/network namespaces or writable cgroup v2 with HugeTLB). Unsupported prerequisites yield SKIP; a failed baseline or valid control is an infrastructure error.
Download the attached runc-conflicting-device-path-reproducer.tar.gz into a fresh working directory, then extract it and run from the extracted directory:
tar -xzf runc-conflicting-device-path-reproducer.tar.gz
cd runc-conflicting-device-path
python3 reproducer/reproduce.py --check-only
sudo python3 reproducer/reproduce.py --runtime /absolute/path/to/runc --output /tmp/runc-conflicting-device-path-replayThe output directory must be new. Each session uses a private mount namespace, a private runtime state root and a unique container ID. Fixtures and cleanup are the original tested framework code. Network fixtures create their own network namespace and veth; they do not move an existing host interface.
The script builds the static probe, checks the runtime baseline, runs paired controls where present, records the candidate and attempts cleanup. Exit 0 means all selected candidates PASS; 1 means an assertion FAIL was collected; 2 means ERROR/SKIP/incomplete execution. Read report.json and per-session result.json, especially cleanup and prerequisite records. A FAIL from another environment still needs review against the expected behavior above.
The configuration templates in the attachment use ${BUNDLE}, ${RESULT}, ${HOOK}, ${PYTHON} and fixture-specific tokens; the included runner renders them. Do not pass an unrendered template directly to the runtime.
Candidate configurations in the extracted directory:
runc-conflicting-device-path-reproducer.tar.gz
reproducer/cases/R48-device-conflict/ordinary-file/config.jsonreproducer/cases/R48-device-conflict/different-device/config.json
Describe the results you received and expected
| Case | Initial | Recorded retest | Failed assertion / observation |
|---|---|---|---|
| R48-device-conflict/ordinary-file | FAIL | FAIL | operation rejected configuration: expected True, observed False |
| R48-device-conflict/different-device | FAIL | FAIL | operation rejected configuration: expected True, observed False |
The attachment preserves raw command snapshots and final stdout/stderr separately in evidence/runs.json, along with controls, states, hook stdin and cleanup. Paths there are redacted to <PROJECT> and <RUNTIME_BUILD>. Cleanup commands are not counted as ordinary lifecycle observations.
What version of runc are you using?
runc version 1.5.0-rc.1+dev
commit: v1.5.0-rc.1-208-g6c72bfe1
spec: 1.3.0
go: go1.25.0
libseccomp: 2.5.5
libpathrs: 0.2.5+devTested source: 6c72bfe151ee.
Host OS information
Ubuntu 24.04.1 LTS, x86_64; root; cgroup v2.
Host kernel information
Linux 6.6.114.1-microsoft-standard-WSL2.
Source: opencontainers/runc