Skip to content

Multicall binary fails to dispatch when invoked via fexecve/execveat(..., AT_EMPTY_PATH) — derives util name from binary path instead of argv[0] #12552

Closed

Description

@simonvik

When the coreutils multicall binary is executed via fexecve(3) / execveat(2) with AT_EMPTY_PATH, execution fails with:

coreutils: unknown program '<fd>'

even though argv[0] is set to a valid utility name (e.g. /bin/echo).

It seems like: AT_EXECFN = /dev/fd/<fd>

And the call looks like :
execveat(3, "", ["/bin/echo", "-n", "param1", "param2", "param3"], 0x7ffeb1056278 /* 0 vars */, AT_EMPTY_PATH) = 0

Tested on ubuntu 26.04 with rust-corutils 0.8.0-0ubuntu3

Activity

  1. oech3 commented on Jun 1, 2026

    @oech3
    Contributor

    We have support for shebang and /proc/self/fd. Is /dev/fd common?

  2. oech3 commented on Nov 30, 2026

    @oech3
    Contributor

    By the way, we have an extensions to mimic individual binaries e.g. resolving dummy -> true.
    I'm planning to support false -> true if binaries are installed as hardlinks.
    We should believe /proc/self/exe instead of argv[0] to mimic individual binaries (and honor AppArmor profile).

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions