Skip to content

Subuidname running as unexpected UID #27903

@RiverNewbury

Description

@RiverNewbury

Issue Description

I have been testing podman in rootless mode with different ways of specifying namespaces. I used --subuidname as an option with options as described here and ran into strange behaviour.

I will say that this may be me misunderstanding or a user error and in that case if you could explain that'd be very useful :)

Steps to reproduce the issue

Steps to reproduce the issue

  1. Edit /etc/subuid and /etc/subgid to contain overlapping uid ranges as described here. Mine is
river:524288:65536
river:10000:65536
test:11000:1024
  1. run podman run -d --rm --name test-container --subuidname test ubi9 sleep 100
  2. run podman top test-container user huser

Describe the results you received

The output of the top command was:

USER        HUSER
root        20999

So the root user in the container is operation as 20999 on the system. Through changing the values under /etc/subuid it became clear that the value in /etc/subuid was being treated as a intermediate uid in the user namespace. So it was the same as using --uidmap=0:11000:1024 (it is definitely using the full range as tested through using the --user flag.

Describe the results you expected

The output I would expect from the top command would be:

USER        HUSER
root          11000

As the mapping was defined in /etc/subuid I would have expected it to be treated as a uid in the initial namespace.

podman info output

host:
  arch: amd64
  buildahVersion: 1.42.2
  cgroupControllers:
  - cpu
  - io
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.13-2.fc43.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.13, commit: '
  cpuUtilization:
    idlePercent: 90.65
    systemPercent: 2.82
    userPercent: 6.53
  cpus: 12
  databaseBackend: sqlite
  distribution:
    distribution: fedora
    variant: workstation
    version: "43"
  eventLogger: journald
  freeLocks: 2030
  hostname: fedora
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 10000
      size: 65536
    - container_id: 65537
      host_id: 524288
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1000
      size: 1
    - container_id: 1
      host_id: 10000
      size: 65536
    - container_id: 65537
      host_id: 524288
      size: 65536
  kernel: 6.17.12-300.fc43.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 636817408
  memTotal: 24960950272
  networkBackend: netavark
  networkBackendInfo:
    backend: netavark
    dns:
      package: aardvark-dns-1.17.0-1.fc43.x86_64
      path: /usr/libexec/podman/aardvark-dns
      version: aardvark-dns 1.17.0
    package: netavark-1.17.1-1.fc43.x86_64
    path: /usr/libexec/podman/netavark
    version: netavark 1.17.1
  ociRuntime:
    name: crun
    package: crun-1.25.1-1.fc43.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.25.1
      commit: 156ae065d4a322d149c7307034f98d9637aa92a2
      rundir: /run/user/1000/crun
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +LIBKRUN +WASM:wasmedge +YAJL
  os: linux
  pasta:
    executable: /usr/bin/pasta
    package: passt-0^20251215.gb40f5cd-1.fc43.x86_64
    version: |
      pasta 0^20251215.gb40f5cd-1.fc43.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
  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
  slirp4netns:
    executable: ""
    package: ""
    version: ""
  swapFree: 8589914112
  swapTotal: 8589930496
  uptime: 18h 37m 57.00s (Approximately 0.75 days)
  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:
  configFile: /home/river/.config/containers/storage.conf
  containerStore:
    number: 0
    paused: 0
    running: 0
    stopped: 0
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/river/.local/share/containers/storage
  graphRootAllocated: 998483427328
  graphRootUsed: 105310887936
  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: 16
  runRoot: /run/user/1000/containers
  transientStore: false
  volumePath: /home/river/.local/share/containers/storage/volumes
version:
  APIVersion: 5.7.1
  BuildOrigin: Fedora Project
  Built: 1765324800
  BuiltTime: Wed Dec 10 00:00:00 2025
  GitCommit: f845d14e941889ba4c071f35233d09b29d363c75
  GoVersion: go1.25.4 X:nodwarf5
  Os: linux
  OsArch: linux/amd64
  Version: 5.7.1

Podman in a container

No

Privileged Or Rootless

Rootless

Upstream Latest Release

Yes

Additional environment details

None

Additional information

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions