Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2853952ybi; Mon, 17 Jun 2019 11:29:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqyggaQTCFofsWvdagjaHD0KyeEGLcCo4H2X0EG7L4eCIeLPFWUgT4iDg7quvmViRM4tO/5s X-Received: by 2002:a63:d512:: with SMTP id c18mr30913680pgg.397.1560792000026; Mon, 17 Jun 2019 10:20:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560792000; cv=none; d=google.com; s=arc-20160816; b=oljlot1V321WOqPGcLlEDrBQLkz2cPJpg8xo6vfQiBDGIiSMahIhhwvWjy+S8aZUbf 2P8x6oDTooAR2vCl5pU03c7dsWgQXtKZxDPzLaIZkU1Bfrqmui+YA795wV9QsH8uP03t H1CYHlr41x27LSYhlwbDl7nTAJ3QTCUq+LQF2x2xuyOBki24aoHMgUKD1Ltw4ZMT0Vq1 kESFZ3l7xg/3crW1qWi7FDroNEbyfvWWgSe4Zj6F8il7g+9VSjjfDOVQ2fFt1YBERRHU xS1G7Qq4rOAC6ptwDtoXByeMEFaHUrtAmF8yAZQZJtc8fDLYjAMgvNw1/M9MB290h7c5 EV7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=t4Zg6P/3rcvHF/Kkh6J9Veq1cGhqPvvomS5CoeMxCEs=; b=DFVj/y+sAPonYCCLsaWr7pUoMVIdZ0aqAqTZSe7gsqqvG3Z605gs61BhBldXmRUHdC ydLpzxzj3h6P8JQUYN1SZU6R1+wVo1oWLEb1wbrvxsVQddMt1BpkiHCtR5KBFDyiXYPr l4FXL1CaVImNNyojvt7oj2T3VczDUNbJPFif7mQ16c7jMgMUttVYweHUDt1qafvoZ7cP iB/JG7UllD5msV1Y+cc3W3ogNvMGlcmtyHuAk+8GutygS2pov2FkvGD7gUsuurRnKjq4 CeSO0fzATCpjm5NaqWHgmdTiAKsK7HVaowM45veUlyg7sCkfnWKa0Z6aIGUKhQVQKbv7 jabQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u5si2082817pgi.218.2019.06.17.10.19.44; Mon, 17 Jun 2019 10:20:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727959AbfFQRSW (ORCPT + 99 others); Mon, 17 Jun 2019 13:18:22 -0400 Received: from foss.arm.com ([217.140.110.172]:57064 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726005AbfFQRSV (ORCPT ); Mon, 17 Jun 2019 13:18:21 -0400 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 A9B7128; Mon, 17 Jun 2019 10:18:20 -0700 (PDT) Received: from arrakis.emea.arm.com (arrakis.cambridge.arm.com [10.1.196.78]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 08B543F246; Mon, 17 Jun 2019 10:18:15 -0700 (PDT) Date: Mon, 17 Jun 2019 18:18:13 +0100 From: Catalin Marinas To: Evgenii Stepanov Cc: Andrey Konovalov , Linux ARM , Linux Memory Management List , LKML , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, kvm@vger.kernel.org, "open list:KERNEL SELFTEST FRAMEWORK" , Vincenzo Frascino , Will Deacon , Mark Rutland , Andrew Morton , Greg Kroah-Hartman , Kees Cook , Yishai Hadas , Felix Kuehling , Alexander Deucher , Christian Koenig , Mauro Carvalho Chehab , Jens Wiklander , Alex Williamson , Leon Romanovsky , Luc Van Oostenryck , Dave Martin , Khalid Aziz , enh , Jason Gunthorpe , Christoph Hellwig , Dmitry Vyukov , Kostya Serebryany , Lee Smith , Ramana Radhakrishnan , Jacob Bramley , Ruben Ayrapetyan , Robin Murphy , Kevin Brodsky , Szabolcs Nagy Subject: Re: [PATCH v17 03/15] arm64: Introduce prctl() options to control the tagged user addresses ABI Message-ID: <20190617171813.GC34565@arrakis.emea.arm.com> References: <20190617135636.GC1367@arrakis.emea.arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 17, 2019 at 09:57:36AM -0700, Evgenii Stepanov wrote: > On Mon, Jun 17, 2019 at 6:56 AM Catalin Marinas wrote: > > On Wed, Jun 12, 2019 at 01:43:20PM +0200, Andrey Konovalov wrote: > > > From: Catalin Marinas > > > > > > It is not desirable to relax the ABI to allow tagged user addresses into > > > the kernel indiscriminately. This patch introduces a prctl() interface > > > for enabling or disabling the tagged ABI with a global sysctl control > > > for preventing applications from enabling the relaxed ABI (meant for > > > testing user-space prctl() return error checking without reconfiguring > > > the kernel). The ABI properties are inherited by threads of the same > > > application and fork()'ed children but cleared on execve(). > > > > > > The PR_SET_TAGGED_ADDR_CTRL will be expanded in the future to handle > > > MTE-specific settings like imprecise vs precise exceptions. > > > > > > Signed-off-by: Catalin Marinas > > > > A question for the user-space folk: if an application opts in to this > > ABI, would you want the sigcontext.fault_address and/or siginfo.si_addr > > to contain the tag? We currently clear it early in the arm64 entry.S but > > we could find a way to pass it down if needed. > > For HWASan this would not be useful because we instrument memory > accesses with explicit checks anyway. For MTE, on the other hand, it > would be very convenient to know the fault address tag without > disassembling the code. I could as this differently: does anything break if, once the user opts in to TBI, fault_address and/or si_addr have non-zero top byte? Alternatively, we could present the original FAR_EL1 register as a separate field as we do with ESR_EL1, independently of whether the user opted in to TBI or not. -- Catalin