From nobody Tue Jun 16 11:42:51 2026 Received: from mail-qk1-f180.google.com (mail-qk1-f180.google.com [209.85.222.180]) (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 9822A372B56 for ; Sun, 19 Apr 2026 04:11:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776571918; cv=none; b=HgLLfP3hznmy5x+EFFCHW8hD6R0Ob/uPqj3bmYmmUS8CpcM9ppVlXwPE3QbxFQtT+ODNI05sinlh4oV9ZVMEqnySdiGg8NR1Nf5h5N8OBESskfriDBysZZJD4eANofwXN+Demcg2OZDSPxbT7Q5qd350Wtn5Ogsh0lln3rd+6SQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776571918; c=relaxed/simple; bh=vOgkCAJEOBJpW+DNT3lDCOCb/13wAHR1oE/eova4bHk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=MHms1L5eYO8RZGL2mg0axKkwMsg2jw+HyCptF7tifHvP1eiIANV7TuUWvQ8ts9g1e99MAtNaMMcKxzupRMvu7fXJrN4iWyu0doETpWSbLCeE48e86ubTSdLJ6/hiibk1rkUFsjk/RQZ+f13uTy4i+Znixo1PXjfwA4TzUhNPMXc= 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=D3aWPneB; arc=none smtp.client-ip=209.85.222.180 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="D3aWPneB" Received: by mail-qk1-f180.google.com with SMTP id af79cd13be357-8d560ede296so222304885a.0 for ; Sat, 18 Apr 2026 21:11:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776571916; x=1777176716; 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=/hH3x1N0+NvSvzMccwee+vm7y2aHZ5XliR6CKhRwp+o=; b=D3aWPneBtbnuA8cX4c+oj928uQCxHpMXRo8QltW1GOBDQX1sIlaRnMTLRXZnJSVbj7 qb+AYTJG52FOyDxbOt874Ax0/GowwFk4w5RqXZr0iwqG1WIZhlq0gnemNbtft7gNvpWq O4p4sB9nOgLsfadneGUgww6pzLDH4J6MYspTTdhwJH24Mi1KLRO2/S1CSIC6gVGCGgGY CtuHBOD2X2oxDjqi6FfBkB7B1Py0BhjQ1H+ImDO3Y/DCaHEAgK/STv8ECVdijWNYzo8e UIJe44bBCRBLbDkPt8twVoOqSwVPWNeRo96Juhjd2Jpcj1L0uEAQlLPcB3j5TQH/9Cy7 HH0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776571916; x=1777176716; 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=/hH3x1N0+NvSvzMccwee+vm7y2aHZ5XliR6CKhRwp+o=; b=tZnejpmdWrUagi4dBNSD71CjrkRB/SVNUBNn4Z/VpiJTQ2UNq1WvJIAWA6B8Qtklpg 94xNPWviXcCdpw933GnoZBFw/BUOKoNcs7BbyfC3ZjRI/+aoPD/k3v+PRSaf2ok736K+ 7hJQRiwizOtEb+oanWiororjcM6IbWEf9cB8oMJs87nZg6C0pPR3gKBK2WA4b8HPMHwq CHLlrACBvuC9isGtPCi7t7EEz2g6ByJzrs6DB/RfhH79hlGUnnEaYhrsy0+RasLlcUyj Qumpcng6un4PlC+4YDlfeSzDsykqGxripATeFvU718JjhHe/hiI7v5vnC8hJBAdiXbZQ RuAg== X-Forwarded-Encrypted: i=1; AFNElJ+pb+vD5tGqA3/xQds6TFs2Vv5RQhsyu2h0rztHgQA0Zw34pyKPZnHkYmuzREaiVYhrMaMJW4dfTu4rwDE=@vger.kernel.org X-Gm-Message-State: AOJu0Yymh7Lb75uLCHiYaKqkoKaiKFWATSvyM94jCMoneqF2Doujxx0C Cxjgavmx2jd0loBEoLlbHMj3uhZvLwdx8i8MJGzKXQn9CkNjaxg0BvKAryS/JlJk X-Gm-Gg: AeBDieueVkaAxiakOvZsFvMg9dahjm9sUSFG/enzfGPR/DazO8KlXkvN1lLM1FMF3h/ zqPrUQiRw4KtTI0iVmem/aepThZzIly6aW461zyyzZusQ5fa/Tv8i3AY84psL1zCnEd1cPBahpY CCPPO9Ml/iUKAG5WN9pjsBmr/FYEC6XdH5KuR/+mWl2ejA7iE3Mc4WSCnw2yzrLvvtpmFOlmHEx x2xagJHNlk6Wt0Vu1+AGQrWD2CyD+YImUi1tCx3HqAUEy29RUQvib8RbyDR+NA2A6D3t+t2Jf4D Y0qQCljjZdmeF2EG8dnuWSAn4FE8kmOZ6iEqdM3MphIARSAEItlNxMo4F9x4GkLJyqpVK+L4d6D QV41vBMXEhjCgmtONfUyu1y/g0UXtFNyi1/waowVD2EvXnbwm1YuoXRqtFLZinMOKiTvRVXXnMg khXhIVhG3AQSSW9644JRjewgoMAvTiplxvX9MOtpRW+CLPHWaFZSxU X-Received: by 2002:a05:620a:460c:b0:8cf:d5ca:ade0 with SMTP id af79cd13be357-8e78c4c2997mr1287310885a.0.1776571915848; Sat, 18 Apr 2026 21:11:55 -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.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Apr 2026 21:11:54 -0700 (PDT) From: Charlie Jenkins Date: Sun, 19 Apr 2026 00:11:02 -0400 Subject: [PATCH 1/2] Documentation/binfmt-misc.rst: Include AT_FLAGS info in "P" flag description 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: quoted-printable Message-Id: <20260419-binfmt_misc_doc_update_p-v1-1-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=1743; i=thecharlesjenkins@gmail.com; s=2026030; h=from:subject:message-id; bh=vOgkCAJEOBJpW+DNT3lDCOCb/13wAHR1oE/eova4bHk=; b=GdILJXyDkjiPFT06nt9j3mMJGZ8zJPsIeTbirlG4obzfAKTqWK8KcylOBCw3+aIEDbtyJ7ffN 4W6attiNsIsBEdwSllepGqZDhmthEzFSz+stS7BB7ND+q4wmE5nXwcy X-Developer-Key: i=thecharlesjenkins@gmail.com; a=ed25519; pk=vpF2USrG+aB6CTbSt34rzJKsAVe/l+GAXo1IomCMETk= Commit 2347961b11d4 ("binfmt_misc: pass binfmt_misc flags to the interpreter") added a bit to AT_FLAGS in the aux vector to notify an interpreter that the 'P' flag was set in binfmt-misc. Clarify that the interpreter is able to be aware of the 'P' flag by using this bit. Signed-off-by: Charlie Jenkins --- Documentation/admin-guide/binfmt-misc.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Documentation/admin-guide/binfmt-misc.rst b/Documentation/admi= n-guide/binfmt-misc.rst index 59cd902e3549..2e2be2922ba6 100644 --- a/Documentation/admin-guide/binfmt-misc.rst +++ b/Documentation/admin-guide/binfmt-misc.rst @@ -61,9 +61,11 @@ Here is what the fields mean: 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 has to be aware of this so it can - execute ``/usr/local/bin/blah`` - with ``argv[]`` set to ``["blah"]``. + ``/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 fla= g is --=20 2.53.0 From nobody Tue Jun 16 11:42:51 2026 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: quoted-printable 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/admi= n-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: =20 ``P`` - preserve-argv[0] Legacy behavior of binfmt_misc is to overwrite - the original argv[0] with the full path to the binary. When th= is - flag is included, binfmt_misc will add an argument to the argu= ment - 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 exec= ve. + When this flag is included, binfmt_misc will add an argument t= o the + argument vector for this purpose, thus preserving the original + ``argv[0]``. e.g. If your interp is set to ``/bin/foo`` and yo= u 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 c= an 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`` w= ith + ``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 fla= g is --=20 2.53.0