From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8405372B31 for ; Sun, 19 Apr 2026 04:11:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776571920; cv=none; b=pzJOh5QGLoZp8U+oMXSjTpyFGyYD+sn0DyKkZAzL0d+pt0duzZcMjFSN9b3fVTYtgqd60XBbNy6nG850GV4TojxQC7Mi+CQrU2is45cmm0J3VmaEmlLuOeqmvsq5R1a+U4LiAFZmuHj6nm8TkbHw1AROKVDd5qbXm6XVCQqRgqk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776571920; c=relaxed/simple; bh=1J5HfoqMCRzodR4Puf6pKmINNdR110Co/q3KXdwFaYs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=LRzrd9vBo5FGre6idRQijtwVpfzTu5akquc/cXx4RXd0mDj3qwNoE3iY3Kij+DGblXaYiDUJ7d406UG6sUtcRom3+uRXlsesQk7KM9PmcmYKSWZde0NStMnBcXNCC22LYVqR/nzyERkH7qqu/EBGpCxz61+WCSwouCB6A7czFik= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Ipl00bKG; arc=none smtp.client-ip=209.85.222.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ipl00bKG" Received: by mail-qk1-f170.google.com with SMTP id af79cd13be357-8cb20bcff5aso187159285a.3 for ; Sat, 18 Apr 2026 21:11:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776571917; x=1777176717; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=2nvHv9jwSE0jszVR+8lSNwcWk7t4hLfdkLVMWS5L8+Q=; b=Ipl00bKGaoEhWQLbCT6f44sBNoJEG25nWlbZCKaW8z+WD4yOaVnphF9/VozyLznlRk /N7LyBsNbg8R/XBNr60RHN3+Te2+gAxBl+RzmQ0w7VgpC/Ed7NeRIeWxwdheffxMtwCe AqnerFPIvBTt3aX2eIE+sy4vz1oBp3GNlSPC5edHDM81f/FmTEsSPtBng93EU2z2Vc+t 90IeqQQ+tZL7eYMN8XSY0oSCnijv/qdfCCp8/15mEGOJ/CHt6REisFl4MYCQsaJfOW2W FAKJVJE2OjLhBGQNiB7evK4mw6yYk7pNe1pAPmV2PUhtWpdID6nnlw16lQa+SY52tE6W PEEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776571917; x=1777176717; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=2nvHv9jwSE0jszVR+8lSNwcWk7t4hLfdkLVMWS5L8+Q=; b=BwLP9d9ceT3LTkvY3skLsr9ja1d+Ve9FYIAm8i4rmCpIcI2nhho8u51tIvhywTLmnt PLedSC4d+OxJGFnwGtEhgR/KHi89IeH3MuT0CRqJntTrTn969Br1Aq/y94lSad1wbrd1 q5L+BVnEBUR+L3qJ59RZdMfIrND/JQTo+dP3bxSoQsoGSUOJX2g0SzJPdUr5m2o8LYf9 jOfHZX1kRPcwgbOGvZcDzqhGBDQ0ucQrvaZK8JcBNienpPXLWZNgIzKd6kIG3o+ZpfpM fG91v7j0Cjc/Er840Nj6W08xYRdrHFOFr53lRU09rrCSKT/aIKUex5EuZhijJBXy1zfD PvzQ== X-Forwarded-Encrypted: i=1; AFNElJ+aR9mBbRonuXXlkcEzYS/8BeaeaRHR3/uNEdrpDbLHAdPgb7ORY8bCCJ9fb/+HfGziKKYNK528VqQmz0Y=@vger.kernel.org X-Gm-Message-State: AOJu0YzSeVNlkiWSYeEHyCg52qVI8v9urmciqN79k6gnxr9OYziCcLjQ +XHIMVbWIK5AVFvDMlXa6mxl7NIli0PqwjUfLGydoa+2h9uby8hmJuowcgqEHKMk X-Gm-Gg: AeBDietq9EadQ7gdmFHfDt4BjwY+5OE/Uq11LIJW+zkNCo9AuwMax935fQXCKrlBnE1 2U25i0oraA3fxhbiVXCMXt2LrJq7/jLIB0P7HA9bi59I3jXm1vsljUw8NX+2Le/x/n200MT6HKC /VuBXH9DbZcuLEMRHxc/WkX+PN1Xjj7vGblgw9GZ5pT3pAEZPfslEEiVTzfBuUCAVW3/W6x6YQo oxjy3bJfZ/ROrcHIOJ/yySOFJihhVDDiDNg/J7yUYNc2H5epgW5O6erz2lU2fBk/83P7ZAyg3dP nM8jxHUuQNIsDjVLOT1Kqo9jhZfWe+IyRBew5hqa7gfBgwg5bJKSggsjMfMPWaqwInPlw7vmn8g W8SWplobiTK3ANVosEvLpbAguO6atZywEpoSC+SqJBLDZ62dbaOgGg70tBQBAjHcY8+sla8Qp5Y mO2lymyfiF6wmk82vxF/NDrjt/A7+BFgU1lFmu/c7YKWJNsnkSS0iX X-Received: by 2002:a05:620a:7102:b0:8d3:d13e:8ed with SMTP id af79cd13be357-8e791c8e81fmr1234467485a.52.1776571917191; Sat, 18 Apr 2026 21:11:57 -0700 (PDT) Received: from inky.localdomain ([2607:fb91:4c8b:380b:91a:9dec:26e7:3d7e]) by smtp.gmail.com with ESMTPSA id af79cd13be357-8e7d5fe98dcsm508388385a.7.2026.04.18.21.11.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Apr 2026 21:11:56 -0700 (PDT) From: Charlie Jenkins Date: Sun, 19 Apr 2026 00:11:03 -0400 Subject: [PATCH 2/2] Documenation/binfmt-misc.rst: Make "P" flag path desc more precise Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260419-binfmt_misc_doc_update_p-v1-2-757c12f33cc2@gmail.com> References: <20260419-binfmt_misc_doc_update_p-v1-0-757c12f33cc2@gmail.com> In-Reply-To: <20260419-binfmt_misc_doc_update_p-v1-0-757c12f33cc2@gmail.com> To: Jonathan Corbet , Shuah Khan , Kees Cook Cc: linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1776571911; l=2657; i=thecharlesjenkins@gmail.com; s=2026030; h=from:subject:message-id; bh=1J5HfoqMCRzodR4Puf6pKmINNdR110Co/q3KXdwFaYs=; b=501vNHBhe3+OspE3Q3Cs8UcA5hXy5KFIkKEwHNX/2W4VCemBfhGg/KIpAPUMFqarz4q02X0DT nVoFX9WlA2lAXlrjaDWV4n3Teb0QBImhSDyVda/6Z6KsXYzhZJse4Sr X-Developer-Key: i=thecharlesjenkins@gmail.com; a=ed25519; pk=vpF2USrG+aB6CTbSt34rzJKsAVe/l+GAXo1IomCMETk= 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 --- 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