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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D645CC3E8C5 for ; Wed, 18 Nov 2020 18:19:09 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 3E4D92087D for ; Wed, 18 Nov 2020 18:19:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="tqUEuzvC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3E4D92087D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=e1mHM6K2jHFnBEKEkz+jTg78VPttYMzw3bDB0B08tdA=; b=tqUEuzvCq3UwqBTpL1QJ+U6Wz prGC605FPW5CyzSQIhM/X7/gWwcjurpLnOj0Y1NgUysRMUoxNsE94BlgG4Hcjzp4TAlT76xcXRZnv 4GHFcLO9s0RiPhMoYfTVm499iZGDP6dThyLP0/BuePKX3M82pp1r7xL+i80iTtv4W6I6Zq3cUM99d 2qV+GEXkMgbkaNDe/ODG6pk/Wdmq1hwKqwroMjgWqgM5zaNA1Qp9yvZozjWSjF8Bd0F9ZvSKGjdXZ t8ss2BzaYVjH5mUvY8C+Te/YMjlbjMi1N59O5LHAfoKfcmy0jFDSt6s0JDbOVRm5yP7XWJBEPU32V rSciLEoMw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfS2L-0008B9-4k; Wed, 18 Nov 2020 18:18:33 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kfS2H-0008Ah-OE for linux-arm-kernel@lists.infradead.org; Wed, 18 Nov 2020 18:18:31 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 79AC911D4; Wed, 18 Nov 2020 10:18:27 -0800 (PST) Received: from arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E4E9E3F718; Wed, 18 Nov 2020 10:18:25 -0800 (PST) Date: Wed, 18 Nov 2020 18:18:22 +0000 From: Dave Martin To: Florian Weimer Subject: Re: [PATCH v2] arm64: Introduce prctl(PR_PAC_{SET,GET}_ENABLED_KEYS) Message-ID: <20201118181821.GJ6882@arm.com> References: <20201014055106.25164-1-pcc@google.com> <87blfv6fj3.fsf@mid.deneb.enyo.de> <20201118171945.GG6882@arm.com> <874klmvafq.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <874klmvafq.fsf@mid.deneb.enyo.de> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201118_131829_862135_8D409DDF X-CRM114-Status: GOOD ( 17.79 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: libc-alpha@sourceware.org, Peter Collingbourne , Andrey Konovalov , Kevin Brodsky , Evgenii Stepanov , Kostya Serebryany , Catalin Marinas , linux-api@vger.kernel.org, Vincenzo Frascino , Will Deacon , Linux ARM 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 Wed, Nov 18, 2020 at 06:31:21PM +0100, Florian Weimer wrote: > * Dave Martin: > > > IIUC the default compiler options when using PAC will only use the > > A key, and only use the PAC instructions that execute as NOPs when the > > affected key is disabled (precisely so that the code still runs on non- > > PAC supporting hardware). But you can't simply flip it on and off while > > there are function frames on the stack that assume it's either on or off. > > I think we can do the switch at the top-most frame, at least in ld.so. > I have not thought about statically linked binaries. 8-/ I guess that's one argument for doing this in the kernel, if it can be done in a compatible way. We might want an antiproperty for this: so ..._PAC means that PAC is used and _PAC|_NOIBKEY|_NODBKEY etc. disables specific keys. (With no flags, we could keep the legacy behaviour of just enabling all the keys, but the program might not use PAC at all.) Alternatively, if the linker provides symbols for the property section, maybe the libc startup could inspect it? I think this section is mapped to PT_LOAD segment in practice. Cheers --Dave _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel