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

@simonvik

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions