Message ID | c327f6bfe8db1ceb5d45a8e0aeba4c46c6c8e064.1729770373.git.thehajime@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3585CCE8E68 for <linux-mm@archiver.kernel.org>; Thu, 24 Oct 2024 12:09:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8BBE16B007B; Thu, 24 Oct 2024 08:09:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 86C4B6B0082; Thu, 24 Oct 2024 08:09:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 733C16B0083; Thu, 24 Oct 2024 08:09:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 5364F6B007B for <linux-mm@kvack.org>; Thu, 24 Oct 2024 08:09:52 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 7559C1412B8 for <linux-mm@kvack.org>; Thu, 24 Oct 2024 12:09:32 +0000 (UTC) X-FDA: 82708376184.08.F8F244A Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) by imf12.hostedemail.com (Postfix) with ESMTP id 7537C40025 for <linux-mm@kvack.org>; Thu, 24 Oct 2024 12:09:41 +0000 (UTC) Authentication-Results: imf12.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Y0lMmzPH; spf=pass (imf12.hostedemail.com: domain of thehajime@gmail.com designates 209.85.216.42 as permitted sender) smtp.mailfrom=thehajime@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1729771637; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=6rxsmZtwDE9hveMIBPCsasEv3gNTZZ8QeBClxURXh1g=; b=fpm504fGI5ZV6x9lfhFkD/X3VtZwXzqIGGrR3MmriLWhmXmltwT3hhMFgxVZEWbQltafSj em7rX4vYW22GKHB7IeB9favcsHeNN4wfRGqCCHpliq6sPTMAXWusClHItbeCwkrN64fQ40 eC0iQDYwDEmr8Wl3N2Z7fSJ7HVTEDj0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1729771637; a=rsa-sha256; cv=none; b=4fIETls4Ev6uhtijciygirtNDnLw2MLvzRLfAT6Bm4zSlrl2BjtOoZSs+7K/AVkonXV5VB TwhyxTQg14t2rtg7F9KLJsWtUmz2v53UDx64U4wtDn99Tl86KPTOjiUL0X8Yc/CsRawH2S tHGzU4sLevnkKwRlcuZ3b5yDJNMV0u4= ARC-Authentication-Results: i=1; imf12.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=Y0lMmzPH; spf=pass (imf12.hostedemail.com: domain of thehajime@gmail.com designates 209.85.216.42 as permitted sender) smtp.mailfrom=thehajime@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2e56750bb0dso615186a91.0 for <linux-mm@kvack.org>; Thu, 24 Oct 2024 05:09:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729771788; x=1730376588; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=6rxsmZtwDE9hveMIBPCsasEv3gNTZZ8QeBClxURXh1g=; b=Y0lMmzPHIQ1gCg7pJlZUpKE/ahzO1yFhkcsEmckC5JephmXQ0ebskEplrd9HLRWCOL gJfBox/KGbeqLLdV+RqIlSedC3hQwMJ2Xg6uoeXtLUjga2/e61mmlLiDkjKLm8Rfwxmv rGhEXw+hyahMI+u2jIzf9+Q8Zkr/zPNygMdiz/mnbRGTIPtRJpH0g9GlXD6ZKTLQp+r0 CRBdZSSTfKZWqEoOFv0F9sXvjNXTpJ+p69E/bzHlJnDv3efDxxpnS9AUSB+s/8jpvIY/ MbL6hnb6yh3nRsVvq2x2drRDG2rGTDbEJyzND/bm01zIjFUnfk1LpEa9eNwEkQr51UBW WSjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729771788; x=1730376588; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6rxsmZtwDE9hveMIBPCsasEv3gNTZZ8QeBClxURXh1g=; b=H8W0ntoewlNNifWZ2utvdn6Y7/1nqJ5Bz+jmc4BSdQZbwcCnuq8oQLY2asesJU2bL5 XxTlImoAOyYUuJtekgYF3u8MnzY89Ty+IVbHCNS37b4Gkf1PKDLRUDwTNK5OMF0mkUKf BijTZVvBW272iaDU/cmPtriuskMMSUcMf2qGl3sGvlP94NF09SEzmpjz9yOkdb5K/3Yj PKidT8rg6QyZ+RGPABUCz7hXfuw1xKwINwebilur9gZDZ+P2okdzIlNihduX3PrBWGAx FaIl1ssOmOGPUmDKF3kuDKxcud3cnLMzjziwvJy3qUxZBRTz/YFuj+NvlNKgWJv47CpE fKzw== X-Forwarded-Encrypted: i=1; AJvYcCU10X0SVqWv3mSi8Rcq0UjI5SqS1VDa2WnJa5NAbaE5fFG2ZzEx87pg6GIyl1jdlmR5//RIhdMuzg==@kvack.org X-Gm-Message-State: AOJu0YyR552ZHcMbp8MeWnLlRz2MkxHmax++ms1ovuyUt5H53ANjBOyt DJ4ZGsswabMvs7cnUByzFn515eq7O+kzKRi5TLmLUBV3+7Tet2Kr X-Google-Smtp-Source: AGHT+IEDeGgbLE/zgvIx9Neo7X/Tvc/kwVBKGo3SVswnkbyJjKLA71wygrf5Z7lZwgpXfxWF3CU2mQ== X-Received: by 2002:a17:90a:f0d2:b0:2e2:973b:f8e7 with SMTP id 98e67ed59e1d1-2e76b70c381mr5909794a91.38.1729771788065; Thu, 24 Oct 2024 05:09:48 -0700 (PDT) Received: from ikb-h07-29-noble.in.iijlab.net ([202.214.97.5]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e76df50eb7sm3335163a91.16.2024.10.24.05.09.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2024 05:09:47 -0700 (PDT) Received: by ikb-h07-29-noble.in.iijlab.net (Postfix, from userid 1010) id 0CDB1D51249; Thu, 24 Oct 2024 21:09:46 +0900 (JST) From: Hajime Tazaki <thehajime@gmail.com> To: linux-um@lists.infradead.org, jdike@addtoit.com, richard@nod.at, anton.ivanov@cambridgegreys.com, johannes@sipsolutions.net Cc: thehajime@gmail.com, ricarkol@google.com, Alexander Viro <viro@zeniv.linux.org.uk>, Christian Brauner <brauner@kernel.org>, Jan Kara <jack@suse.cz>, Eric Biederman <ebiederm@xmission.com>, Kees Cook <kees@kernel.org>, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: [RFC PATCH 01/13] fs: binfmt_elf_efpic: add architecture hook elf_arch_finalize_exec Date: Thu, 24 Oct 2024 21:09:09 +0900 Message-ID: <c327f6bfe8db1ceb5d45a8e0aeba4c46c6c8e064.1729770373.git.thehajime@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <cover.1729770373.git.thehajime@gmail.com> References: <cover.1729770373.git.thehajime@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 7537C40025 X-Stat-Signature: brbd46amzu35o45nnnh375yu1je3x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kLxi1VXFzNXulqNNUS1aSYumMIRAmUYUXyEd5qRrY3ipkDpdzA+vXwtWvpp1onRJeKE2sXxs6ZYssPVtGcs83eFrTWfDGg0npnhGhYWMedjYlp8dN/SuLLJWruohF5sqvDcD30RYc5ZwMy+4Af2ZzJhRuwuLVwVbR9PwVo8mmOB99yJU1iuL+dKJ+YFA8a+jg6mhNx4aFg6u3IT8eMCepzaz5mrOHPn8O5tsWToNyKCIwfTcD7X/AAc6mGDbxeTnPiSz2Sn6oDP833gd1hmcDlgfZcMFcfkXntkAQTOnu9xb/lGGHfJLms79SsELEAbj/UTTd7xPmgb4YMzFhvXGYpo6tJeSD5j/cSG+WmD32VEowFmd0bGDyGyzGHkltb9vwSXhwa4mebSvJgwuRPi+jT+oDDNNB9Igj1BLwyzYYXbzZ/tbt7nmRvHwxe+R538ITVSbiN3kUkcZdy72EemCA1rpqk4ntMvnSTSj5pAJZcNv+kMNCMrA1dBva2lccrUdj8QC15TjcQtXoT17mEdpMU/zmzfRAeuiH3AxBE6Hr92zEuy3noyM+LECsZ1HZ/KC/Go/1OlBfeosBgTC8QJJgbEjug== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
[RFC,01/13] fs: binfmt_elf_efpic: add architecture hook elf_arch_finalize_exec
|
expand
|
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index 4fe5bb9f1b1f..ab16fdf475b0 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c @@ -175,6 +175,12 @@ static int elf_fdpic_fetch_phdrs(struct elf_fdpic_params *params, return 0; } +int __weak elf_arch_finalize_exec(struct elf_fdpic_params *exec_params, + struct elf_fdpic_params *interp_params) +{ + return 0; +} + /*****************************************************************************/ /* * load an fdpic binary into various bits of memory @@ -457,6 +463,10 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm) dynaddr); #endif + retval = elf_arch_finalize_exec(&exec_params, &interp_params); + if (retval) + goto error; + finalize_exec(bprm); /* everything is now ready... get the userspace context ready to roll */ entryaddr = interp_params.entry_addr ?: exec_params.entry_addr;
FDPIC ELF loader adds an architecture hook at the end of loading binaries to finalize the mapped memory before moving toward exec function. The hook is used by UML under !MMU when translating syscall/sysenter instructions before calling execve. Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Christian Brauner <brauner@kernel.org> Cc: Jan Kara <jack@suse.cz> Cc: Eric Biederman <ebiederm@xmission.com> Cc: Kees Cook <kees@kernel.org> Cc: linux-fsdevel@vger.kernel.org Cc: linux-mm@kvack.org Signed-off-by: Hajime Tazaki <thehajime@gmail.com> --- fs/binfmt_elf_fdpic.c | 10 ++++++++++ 1 file changed, 10 insertions(+)