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=-6.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,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 AE05DC12002 for ; Fri, 16 Jul 2021 16:49:56 +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 72464613E8 for ; Fri, 16 Jul 2021 16:49:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 72464613E8 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=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:Cc:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=T2KPGNpDyALqX5+Kd6L3HFPichmqsKD0KbL3MHsYJ+s=; b=uUI3RQbRTBRzuwkrZVeAjV0B3G gR4eGUb5tqVUEdYbafNsXZBsuGFqKeOe+OdD/PWSxacLc739jyI0odh695HhJ1NQpJ0yPeHp/ycUa LUTJiZLMsyAm31Geqoha3Exb4TH1vMRcNgJvqFwinshwyDKqBV8XlR6UWjZrFqZsrqOERW+crtWjR Y/hfXujVNWxL83Wb9wD8E8MPseE2AxJ00DpHReN9GFLAxhkKJkkLzKXHck5pTMSfefnfD/KLvYqWn dD4Ur0LAqTqVpM4zrN9lC5qxmIrYiEBqPJ8XVLxrbGQk9PqoznoUhKWlCafmEBgWqjU1ihNqFikVy PwjfNgUw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m4R0e-004ufq-5k; Fri, 16 Jul 2021 16:48:20 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m4R0Z-004ufQ-Tq for linux-arm-kernel@lists.infradead.org; Fri, 16 Jul 2021 16:48:17 +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 4941A31B; Fri, 16 Jul 2021 09:48:13 -0700 (PDT) Received: from [10.57.36.240] (unknown [10.57.36.240]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 4D2AE3F7D7; Fri, 16 Jul 2021 09:48:12 -0700 (PDT) Subject: Re: [PATCH] ARM64: Provide the ARM64_TBI option To: Peter Collingbourne Cc: Will Deacon , Yuan Li , Catalin Marinas , Linux ARM , twd2.me@gmail.com References: <20210714180640.22229-1-lydorazoe@gmail.com> <854a541f-0156-2465-b640-47c0d065f87f@arm.com> <20210715161124.GA1330@willie-the-truck> From: Robin Murphy Message-ID: Date: Fri, 16 Jul 2021 17:48:06 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Language: en-GB X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210716_094816_115041_E52892BD X-CRM114-Status: GOOD ( 22.93 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2021-07-16 17:14, Peter Collingbourne wrote: > On Fri, Jul 16, 2021 at 1:09 AM Robin Murphy wrote: >> >> On 2021-07-15 17:11, Will Deacon wrote: >>> On Wed, Jul 14, 2021 at 07:43:03PM +0100, Robin Murphy wrote: >>>> On 2021-07-14 19:06, Yuan Li wrote: >>>>> The ARM64 provides the Top Byte Ignore (TBI) early on, so the kernel turns TBI >>>>> on by default, but, it does not provide any option to turn the feature off. >>>>> >>>>> In ARMv8.3, the Pointer Authentication (PA) was introduced, and if TBI is >>>>> turned off, the PA will be able to use the top byte, resulting longer pointer >>>>> authentication codes, which is more secure. >>>>> >>>>> This patch changes the default support for the TBI to an option that can be >>>>> turned off. >>>> >>>> This would have to be something that processes explicitly opt in to. See >>>> Documentation/arm64/tagged-pointers.rst - silently disabling TBI0 *will* >>>> break existing userspace software. >>> >>> Maybe the patch from Peter: >>> >>> https://lore.kernel.org/r/20210622051204.3682580-1-pcc@google.com >>> >>> is a better starting point? >> >> Yeah, a command-line opt-in is certainly a more reasonable approach. >> However it still seems to me that it would make most sense as a >> per-process thing like the tagged address syscall ABI, since it's of no >> automatic benefit to existing software built without pointer auth, and >> AFAICS it's really up to individual programs whether they care more >> about stronger signing than tagged pointers. It was bad enough when we >> changed the VA_BITS default to 48 and discovered just how many things >> were using the Mozilla JIT, so I'm not sure I relish the thought of >> going through the same process with TBI0 ;) >> >> >> Come to think of it I guess any option should probably disable the >> tagged address syscall ABI, as that doesn't make much sense without >> TBI0. Are we likely to want a signed pointer syscall ABI as well? >> >> Robin. > > Bear in mind that disabling TBI0 disables the ability to use MTE. At > least from our perspective, MTE is considered a more valuable > mitigation than PAC. That's why we're only intending to disable TBI > for code pointers, not for data pointers (via TBID0). > > As Catalin wrote in [1], having this be a per-process option would be > more expensive, and may even be infeasible with the current > architecture. That's why we decided to go with a command line option. Ah, now it starts to make more sense, thanks for the prod. TBH I'm not sure I'd even noticed that PAuth added that subtlety, and I definitely failed to read your patch closely enough :) > [1] https://lore.kernel.org/linux-arm-kernel/20201124184742.GC42276@C02TF0J2HF1T.local/ No argument with the reasoning on that thread from me - looks like you're at least as wary as I am. Sorry for the confusion! Cheers, Robin. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel