[PATCH 2/2] Documenation/binfmt-misc.rst: Make "P" flag path desc more precise
From: Charlie Jenkins
Date: Sun Apr 19 2026 - 00:12:44 EST
The "full path" is not passed through to the interpreter, but rather
whatever path was passed to execve. The user's shell is the mechanism
that is converting the executable name "blah" into the full path name of
"/usr/local/bin/blah" instead of the kernel. Clarify this in the
documentation by noting that the path is found in execve and including
"shell" in the conversation for locating "blah".
Signed-off-by: Charlie Jenkins <thecharlesjenkins@xxxxxxxxx>
---
Documentation/admin-guide/binfmt-misc.rst | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/Documentation/admin-guide/binfmt-misc.rst b/Documentation/admin-guide/binfmt-misc.rst
index 2e2be2922ba6..aabf6599ac49 100644
--- a/Documentation/admin-guide/binfmt-misc.rst
+++ b/Documentation/admin-guide/binfmt-misc.rst
@@ -56,16 +56,16 @@ Here is what the fields mean:
``P`` - preserve-argv[0]
Legacy behavior of binfmt_misc is to overwrite
- the original argv[0] with the full path to the binary. When this
- flag is included, binfmt_misc will add an argument to the argument
- vector for this purpose, thus preserving the original ``argv[0]``.
- e.g. If your interp is set to ``/bin/foo`` and you run ``blah``
- (which is in ``/usr/local/bin``), then the kernel will execute
- ``/bin/foo`` with ``argv[]`` set to ``["/bin/foo",
- "/usr/local/bin/blah", "blah"]``. The interp can be aware of this
- by checking if bit 0 in AT_FLAGS in the auxilary vector is set to 1
- so it can execute ``/usr/local/bin/blah`` with ``argv[]`` set to
- ``["blah"]``.
+ the original argv[0] with the path to the binary found in execve.
+ When this flag is included, binfmt_misc will add an argument to the
+ argument vector for this purpose, thus preserving the original
+ ``argv[0]``. e.g. If your interp is set to ``/bin/foo`` and you run
+ ``blah`` (which your shell finds in ``/usr/local/bin``), then the
+ kernel will execute ``/bin/foo`` with ``argv[]`` set to
+ ``["/bin/foo", "/usr/local/bin/blah", "blah"]``. The interp can be
+ aware of this by checking if bit 0 in AT_FLAGS in the auxilary
+ vector is set to 1 so it can execute ``/usr/local/bin/blah`` with
+ ``argv[]`` set to ``["blah"]``.
``O`` - open-binary
Legacy behavior of binfmt_misc is to pass the full path
of the binary to the interpreter as an argument. When this flag is
--
2.53.0