From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B620EC433EF for ; Tue, 9 Nov 2021 19:43:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 852D46115A for ; Tue, 9 Nov 2021 19:43:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 852D46115A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=mmfV3XX8u7LF3wOWFdlJpd9ufET0sMYBDmb3otof4/k=; b=APLtCzJCfXqG2t Ta52Wfsq0qsY2jM+ve2dRVZCYXgyREoL3VXMKMkchyw/hgLltcN863DpKLkx1YlrxRYkhaWqsuO0z DcTX9VevApd+geax+O6ZnTCpJmTC+MuVw96NGaV6eG0mhhA46MgsUsL/lQYYuBxr6XQM+fXkrzOaF iI11mWTu3xqfWD1T0aUXh5LnrsWdQRMVHidxJiP866x4lCYt7uMfXhMi8koGJ35wnplZvBcxVTZZz CTOtlXNwl18L3TE9QHnK7x6lgsqUvw6q+eP2Yp55vwcSnWCA7J372MHJsbNR724+/9QaJ4Q1AIiCd K17Er9k+UXWAHLY7R7ZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkX0t-0037bG-86; Tue, 09 Nov 2021 19:42:35 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkX0q-0037ay-UP for linux-arm-kernel@bombadil.infradead.org; Tue, 09 Nov 2021 19:42:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=5XIGjkcGERAZzzieuikWA1xHtahXazjRcK+wygMzymM=; b=WKWDuZNuWlOOcpDVQuK6Xl1kSY Ed13XediStqyXCnxwD9QZzahRcQMBaWkAsAHnY2SGUIKfgx63Y2nHmc0++fR9fqIu+fdUpb/grb/J ClsuHE03J3dqw76LVtLWs77d0VTO+wYQ8u4VIclk2S39zvs90ZkBCkZjrKE36+Kej+8e6hfuA1B9s tWYvCmsP9yx2TNmthj7PMno1BEYAJ2ITWNTQixWtrHeIodrSkBzcjGVK6BrWpiqpStusU+/xSYBaa sAuyY6ESdY+50u3pjB1kJefmDMpk2pwEH1QO8CWmslMwxeOwOyosy86BzS+McIG788gv5Jxt4UN9s H9ETOffQ==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mkX0n-001I9n-EV; Tue, 09 Nov 2021 19:42:30 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id CC6D03000A3; Tue, 9 Nov 2021 20:42:29 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id BC2292C525D3C; Tue, 9 Nov 2021 20:42:29 +0100 (CET) Date: Tue, 9 Nov 2021 20:42:29 +0100 From: Peter Zijlstra To: Ard Biesheuvel Cc: Linux Kernel Mailing List , Linux ARM , Josh Poimboeuf , Jason Baron , Steven Rostedt , Mark Rutland , Kees Cook Subject: Re: [RFC PATCH 3/7] static_call: use helper to access non-exported key Message-ID: References: <20211109164549.1724710-1-ardb@kernel.org> <20211109164549.1724710-4-ardb@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Nov 09, 2021 at 07:54:23PM +0100, Ard Biesheuvel wrote: > On Tue, 9 Nov 2021 at 19:53, Peter Zijlstra wrote: > > > > On Tue, Nov 09, 2021 at 05:45:45PM +0100, Ard Biesheuvel wrote: > > > @@ -196,13 +190,21 @@ extern long __static_call_return0(void); > > > EXPORT_SYMBOL_GPL(STATIC_CALL_KEY(name)); \ > > > EXPORT_SYMBOL_GPL(STATIC_CALL_TRAMP(name)) > > > > > > +#define EXPORT_STATIC_CALL_GETKEY_HELPER(name) \ > > > + struct static_call_key *STATIC_CALL_GETKEY(name)(void) { \ > > > + BUG_ON(!core_kernel_text( \ > > > + (unsigned long)__builtin_return_address(0))); \ > > > + return &STATIC_CALL_KEY(name); \ > > > + } \ > > > + EXPORT_SYMBOL_GPL(STATIC_CALL_GETKEY(name)) > > > > So if I were a nevarious module, I would look up the above symbol from > > kallsyms (it is exported and easily obtainable) and then simply > > read the text to discover the key address and we're in business. > > > > Yeah I realised that. So would you prefer to have a > .static_call_tramp_key section in each module and look up the keys in > the module loader? Think so... do you actually have a need for this? _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel