podman icon indicating copy to clipboard operation
podman copied to clipboard

Mounted secrets fail in --read-only containers with crun 1.31

Open mwdle opened this issue 2 weeks ago • 1 comments

Issue Description

After upgrading crun 1.30.1 to crun 1.31, rootless containers combining a read-only root filesystem with a mounted Podman secret fail during container creation.

The minimal failing combination is simply:

  • --read-only
  • a mounted --secret

Environment-type secrets are unaffected.

I tested the same command with the same Podman installation and image while selecting different crun binaries:

  • crun 1.30.1: succeeds
  • crun 1.31: fails with exit status 127

Steps to reproduce the issue

  1. Create a disposable secret:

    printf x | podman secret create test -
    
  2. Run a read-only container with the mounted secret:

    podman run --rm --read-only --secret test registry.fedoraproject.org/fedora-minimal:45 /bin/true
    

Describe the results you received

Container creation fails before /bin/true is executed:

Error: crun: open `/home/<user>/.local/share/containers/storage/overlay/<id>/merged/run/secrets/test`: No such file or directory: OCI runtime attempted to invoke a command that was not found

Describe the results you expected

The secret should be mounted at /run/secrets/test, /bin/true should execute, and the container should exit successfully.

Mounted secrets and read-only root filesystems are independently documented Podman features and worked together with crun 1.30.1.

podman info output

host:
  arch: amd64
  buildahVersion: 1.46.0
  cdiSpecDirs:
  - /etc/cdi
  - /var/run/cdi
  cgroupControllers:
  - cpu
  - io
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.2.1-2.fc45.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.2.1, commit: '
  cpuUtilization:
    idlePercent: 96.12
    systemPercent: 1.07
    userPercent: 2.81
  cpus: 16
  databaseBackend: sqlite
  distribution:
    distribution: fedora
    variant: kde
    version: "45"
  eventLogger: journald
  freeLocks: 2048
  hostname: p1
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 524288
      size: 65536
    - container_id: 65537
      host_id: 10000000
      size: 100000001
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 524288
      size: 65536
    - container_id: 65537
      host_id: 10000000
      size: 100000001
  kernel: 7.3.4-300.fc45.x86_64
  linkmode: dynamic
  logDriver: journald
  memAvailable: 25127796736
  memFree: 9523634176
  memTotal: 33341689856
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    defaultNetwork: podman
    dns:
      package: aardvark-dns-2.1.0-1.fc45.x86_64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 2.1.0
    package: netavark-2.1.0-1.fc45.x86_64
    path: /usr/libexec/podman/netavark
    version: netavark 2.1.0
  ociRuntime:
    features: '{"ociVersionMin":"1.0.0","ociVersionMax":"1.1.0+dev","hooks":["prestart","createRuntime","createContainer","startContainer","poststart","poststop"],"mountOptions":["rw","rrw","ro","rro","rdirsync","rdiratime","rnodev","rnorelatime","nodiratime","rnodiratime","dirsync","rnosuid","ratime","diratime","rnoatime","strictatime","rstrictatime","noatime","rnostrictatime","rnomand","nostrictatime","rnoexec","nodev","rmand","norelatime","mand","idmap","atime","nomand","noiversion","rbind","rslave","bind","defaults","rrelatime","rprivate","noexec","rsync","remount","dest-nofollow","silent","dev","rdev","iversion","relatime","rsuid","sync","suid","async","rasync","nosuid","rexec","shared","rshared","src-nofollow","slave","loud","private","exec","tmpcopyup","unbindable","runbindable","copy-symlink"],"linux":{"namespaces":["cgroup","ipc","mount","network","pid","user","uts"],"capabilities":["CAP_CHOWN","CAP_DAC_OVERRIDE","CAP_DAC_READ_SEARCH","CAP_FOWNER","CAP_FSETID","CAP_KILL","CAP_SETGID","CAP_SETUID","CAP_SETPCAP","CAP_LINUX_IMMUTABLE","CAP_NET_BIND_SERVICE","CAP_NET_BROADCAST","CAP_NET_ADMIN","CAP_NET_RAW","CAP_IPC_LOCK","CAP_IPC_OWNER","CAP_SYS_MODULE","CAP_SYS_RAWIO","CAP_SYS_CHROOT","CAP_SYS_PTRACE","CAP_SYS_PACCT","CAP_SYS_ADMIN","CAP_SYS_BOOT","CAP_SYS_NICE","CAP_SYS_RESOURCE","CAP_SYS_TIME","CAP_SYS_TTY_CONFIG","CAP_MKNOD","CAP_LEASE","CAP_AUDIT_WRITE","CAP_AUDIT_CONTROL","CAP_SETFCAP","CAP_MAC_OVERRIDE","CAP_MAC_ADMIN","CAP_SYSLOG","CAP_WAKE_ALARM","CAP_BLOCK_SUSPEND","CAP_AUDIT_READ","CAP_PERFMON","CAP_BPF","CAP_CHECKPOINT_RESTORE"],"cgroup":{"v1":true,"v2":true,"systemd":true,"systemdUser":true},"seccomp":{"enabled":true,"actions":["SCMP_ACT_ALLOW","SCMP_ACT_ERRNO","SCMP_ACT_KILL","SCMP_ACT_KILL_PROCESS","SCMP_ACT_KILL_THREAD","SCMP_ACT_LOG","SCMP_ACT_NOTIFY","SCMP_ACT_TRACE","SCMP_ACT_TRAP"],"operators":["SCMP_CMP_NE","SCMP_CMP_LT","SCMP_CMP_LE","SCMP_CMP_EQ","SCMP_CMP_GE","SCMP_CMP_GT","SCMP_CMP_MASKED_EQ"]},"apparmor":{"enabled":true},"selinux":{"enabled":true},"mountExtensions":{"idmap":{"enabled":true}},"intelRdt":{"enabled":true},"netDevices":{"enabled":true},"memoryPolicy":{"modes":["MPOL_DEFAULT","MPOL_PREFERRED","MPOL_BIND","MPOL_INTERLEAVE","MPOL_LOCAL","MPOL_PREFERRED_MANY","MPOL_WEIGHTED_INTERLEAVE"],"flags":["MPOL_F_NUMA_BALANCING","MPOL_F_RELATIVE_NODES","MPOL_F_STATIC_NODES"]}},"annotations":{"io.github.seccomp.libseccomp.version":"2.6.1","org.opencontainers.runc.checkpoint.enabled":"true","run.oci.crun.checkpoint.enabled":"true","run.oci.crun.commit":"a84965e1278d08d6c75d5b8a41a3e72a7a11fa5b","run.oci.crun.version":"1.31","run.oci.crun.wasm":"true"},"potentiallyUnsafeConfigAnnotations":["module.wasm.image/variant","io.kubernetes.cri.container-type","run.oci.","org.criu.","krun."]}'
    name: crun
    package: crun-1.31-1.fc45.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.31
      commit: a84965e1278d08d6c75d5b8a41a3e72a7a11fa5b
      rundir: /run/user/1000/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +JSON_C
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt-0^20261002.gcba3570-1.fc45.x86_64
    version: |
      pasta 0^20261002.gcba3570-1.fc45.x86_64
      Copyright Red Hat
      GNU General Public License, version 2 or later
        <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
      This is free software: you are free to change and redistribute it.
      There is NO WARRANTY, to the extent permitted by law.
  remoteSocket:
    exists: true
    path: /run/user/1000/podman/podman.sock
  rootlessNetworkCmd: pasta
  rootlessPortForwarder: rootlessport
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  swapFree: 8589930496
  swapTotal: 8589930496
  uptime: 0h 34m 18.00s
  variant: ""
plugins:
  authorization: null
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  - ipvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
store:
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions:
    overlay.mountopt: nodev
  graphRoot: /home/mwdle/.local/share/containers/storage
  graphRootAllocated: 997409685504
  graphRootUsed: 512594214912
  graphStatus:
    Backing Filesystem: btrfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Supports shifting: "false"
    Supports volatile: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 10
  runRoot: /run/user/1000/containers
  transientStore: false
  volumePath: /home/mwdle/.local/share/containers/storage/volumes
version:
  APIVersion: 6.2.0
  BuildOrigin: Fedora Project
  Built: 1794268800
  BuiltTime: Mon Nov  9 17:00:00 2026
  GitCommit: 055de046937d29450f310fce0fe3071485d8bed9
  GoVersion: go1.27.3-X:nodwarf5
  Os: linux
  OsArch: linux/amd64
  Version: 6.2.0

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

Yes

Additional environment details

Tested on Fedora 45 (x86_64) using:

  • podman-6.2.0-1.fc45.x86_64 from Fedora updates-testing
  • crun-1.31-1.fc45.x86_64

Additional information

No response

mwdle avatar Nov 18 '26 02:11 mwdle

Hi, would be happy to give this a go!

nadav78 avatar Nov 18 '26 09:11 nadav78