From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from albireo.enyo.de (albireo.enyo.de [37.24.231.21]) by sourceware.org (Postfix) with ESMTPS id 329F3386F41D for ; Tue, 17 Nov 2020 17:48:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 329F3386F41D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=deneb.enyo.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=fw@deneb.enyo.de Received: from [172.17.203.2] (helo=deneb.enyo.de) by albireo.enyo.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) id 1kf55X-0005cw-8T; Tue, 17 Nov 2020 17:48:19 +0000 Received: from fw by deneb.enyo.de with local (Exim 4.92) (envelope-from ) id 1kf55U-0000Uk-2v; Tue, 17 Nov 2020 18:48:16 +0100 From: Florian Weimer To: Peter Collingbourne Cc: Catalin Marinas , Evgenii Stepanov , Kostya Serebryany , Vincenzo Frascino , Dave Martin , Linux ARM , Kevin Brodsky , Andrey Konovalov , Will Deacon , linux-api@vger.kernel.org, libc-alpha@sourceware.org Subject: Re: [PATCH v2] arm64: Introduce prctl(PR_PAC_{SET,GET}_ENABLED_KEYS) References: <20201014055106.25164-1-pcc@google.com> Date: Tue, 17 Nov 2020 18:48:16 +0100 In-Reply-To: <20201014055106.25164-1-pcc@google.com> (Peter Collingbourne's message of "Tue, 13 Oct 2020 22:51:06 -0700") Message-ID: <87blfv6fj3.fsf@mid.deneb.enyo.de> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Nov 2020 17:48:29 -0000 * Peter Collingbourne: > This prctl allows the user program to control which PAC keys are enabled > in a particular task. The main reason why this is useful is to enable a > userspace ABI that uses PAC to sign and authenticate function pointers > and other pointers exposed outside of the function, while still allowing > binaries conforming to the ABI to interoperate with legacy binaries that > do not sign or authenticate pointers. > > The idea is that a dynamic loader or early startup code would issue > this prctl very early after establishing that a process may load legacy > binaries, but before executing any PAC instructions. I thought that the silicon did not support this? What exactly does this switch on and off? The signing itself (so that the bits are zero again), or just the verification? I do not know how easy it will be to adjust the glibc dynamic linker to this because I expect it to use PAC instructions itself. (It is an interesting target, I suppose, so this makes sense to me.) The loader code used for initial process setup and later dlopen is the same. Worst case, we could compile the loader twice. There is also an issue with LD_AUDIT, where we run user-supplied code (which might be PAC-compatible) before loading code that is not. I guess we could disable PAC by default in LD_AUDIT mode (which is unusual, no relation to the kernel audit subsystem).