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=-0.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 A24D8CA90AF for ; Tue, 12 May 2020 17:12:21 +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 68DED206B8 for ; Tue, 12 May 2020 17:12:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IuoGv+cz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 68DED206B8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-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.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=zi8Fvei3+AkFWrzdOJyie70yHkssWFPgPvQ29JLvX+8=; b=IuoGv+czFWICpD 225XBcWy5s20/nXVrbs/kd/CgNvNRI8Z7couiclexA9GwnNO+CkgXqFKt/Sa7bTMNoz9lIOzSZTCO zSHPl1+PgUzlu1GaC2EWgVB8AJtMTJjMSyCBZQEgBnbDstBxQ9fVJ0UnZnEIv5cR6tn8fSCYACgeF yd8T4mNwdl2UUVUYmtZFPk83Fc3VQT0eekD6OlIh3JUKghP0xs5KzrAGljUwjcxmU8ppcw4kd841r tOnYjT2BQULR2GmNeW6O0LwO4tix1T5cSOKv406ns5ynwgoRnSfRbsu1IPvYaiFZYky05E+BH7ziB ePTpjvwm6v7nl/Gr5Nww==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYYS4-0007tn-3C; Tue, 12 May 2020 17:12:20 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jYYS0-0007tT-Vb for linux-arm-kernel@lists.infradead.org; Tue, 12 May 2020 17:12:18 +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 19CCD1FB; Tue, 12 May 2020 10:12:16 -0700 (PDT) Received: from C02TF0J2HF1T.local (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 23AD13F305; Tue, 12 May 2020 10:12:12 -0700 (PDT) Date: Tue, 12 May 2020 18:12:09 +0100 From: Catalin Marinas To: Amit Kachhap Subject: Re: [PATCH v2 2/4] arm64: ptrauth: add pointer authentication Armv8.6 enhanced feature Message-ID: <20200512171209.GA21213@C02TF0J2HF1T.local> References: <1586842314-19527-1-git-send-email-amit.kachhap@arm.com> <1586842314-19527-3-git-send-email-amit.kachhap@arm.com> <20200506163155.GG2878@gaia> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200512_101217_059418_2ECCA83D X-CRM114-Status: GOOD ( 20.44 ) 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: Mark Rutland , Kees Cook , Suzuki K Poulose , Kristina Martsenko , Mark Brown , James Morse , Vincenzo Frascino , Will Deacon , Dave Martin , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, May 07, 2020 at 08:58:51PM +0530, Amit Kachhap wrote: > On 5/6/20 10:01 PM, Catalin Marinas wrote: > > On Tue, Apr 14, 2020 at 11:01:52AM +0530, Amit Daniel Kachhap wrote: > > > This patch add changes for Pointer Authentication enhanced features > > > mandatory for Armv8.6. These features are, > > > > > > * Uses an enhanced PAC generation logic which hardens finding the correct > > > PAC value of the authenticated pointer. However, no code change done > > > for this. > > > > > > * Fault(FPAC) is generated now when the ptrauth authentication instruction > > > fails in authenticating the PAC present in the address. This is different > > > from earlier case when such failures just adds an error code in the top > > > byte and waits for subsequent load/store to abort. The ptrauth > > > instructions which may cause this fault are autiasp, retaa etc. > > > > > > The above features are now represented by additional configurations > > > for the Address Authentication cpufeature. > > > > > > The fault received in the kernel due to FPAC is treated as Illegal > > > instruction and hence signal SIGILL is injected with ILL_ILLOPN as the > > > signal code. Note that this is different from earlier ARMv8.3 ptrauth > > > where signal SIGSEGV is issued due to Pointer authentication failures. [...] > > While the new behaviour is a lot more useful in practice, I wonder > > whether we could still emulate the old one by setting regs->pc to a > > faulting address and returning to user. > > However even if we set regs->pc to the faulting lr address but this lr > may not be same as earlier one as theoretically there can be two autia > instructions so I am not sure if complete emulation is possible. Also other > work will be change ESR value, set error pattern in the faulting address etc > when the error pattern is itself not defined. You are right, we can't fully emulate this. I was thinking of getting a fake faulting PC and returning to it so that we trigger a SIGSEGV. Anyway, I don't think it buys us anything and I really doubt we have user space relying on the 8.3 behaviour. -- Catalin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel