Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3025776ybi; Mon, 17 Jun 2019 15:00:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpkq+I8EIFLWwaExNg4KuZzYovst9DpoH0uJAOms45/6xfqDEZNGA5fKfksyXcDsLqQWA3 X-Received: by 2002:a17:902:29c3:: with SMTP id h61mr74978006plb.37.1560808803404; Mon, 17 Jun 2019 15:00:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560808803; cv=none; d=google.com; s=arc-20160816; b=ZSUB4TA+NvXCfHxUDD4lYGK+CBJHE+G5fxLge0O0r70jIAlyxhNYUS1s4yrm1DB8fI uwf/KQRTT5cq+nArzuSoLpCp4scI7XtIBPNSxCAlaGqzxHsIvoxfhulQvk95eSRuxgyW lMYwlemCMVcIgJu+C5OJ1fxmrtS37R94akJPQMYobT2tY7CvgF2w5Eds4UzV7d3w9FH6 2bYBriWxeBOF50g1oCbNryyCbIBKlB7zsMG3uIgSVqGRmyNAUCkbUb1g4Yu752PUuYgA 1fph0LvK8sdTr5T3v/lKdOf9XBarjfMHxwFF+4Fr3V8D4015cgx/a7oqVJ2fJ+yX15rs vtcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=EAhatab0HAVyw+PnT7+3nUVy3uXQEI6O1vd8Cnx2LKk=; b=kO5bVoX3hR12U975/tMHGYNI7iMH7dhjR4xjjTXik84RkCkrTj0ihM8xHN42FIGqBA 0umAHcy4vfS+OwHZL1nfvyK2psnQH37S6/XtBaQ1Jn2h3h1iILctErKZ2D7LPTOv0GiR iZYQL0xPqrHfpX2XWaAaycyztEbPp0hhYpQhTeBbCgmAV+sl1zmaWfZqxLSTpWpjJjGa sG5RYX6rpRSGoB47N2xh4RfMGCBb28dwFe9akKBdTEYdpduVZO0gAmtgwsyl0DDZDUOw HBsHRQ5fz4QUIF9+E30iYPUSYzHdIiI0//M6hmbzZ/f6kgqAgvxgVeW8XlsfPy6aAkjt aNSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=kvgoo1AW; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c1si10661031pll.194.2019.06.17.14.59.47; Mon, 17 Jun 2019 15:00:03 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=kvgoo1AW; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727027AbfFQV7m (ORCPT + 99 others); Mon, 17 Jun 2019 17:59:42 -0400 Received: from mail-ua1-f65.google.com ([209.85.222.65]:34300 "EHLO mail-ua1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726776AbfFQV7m (ORCPT ); Mon, 17 Jun 2019 17:59:42 -0400 Received: by mail-ua1-f65.google.com with SMTP id c4so4142692uad.1 for ; Mon, 17 Jun 2019 14:59:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EAhatab0HAVyw+PnT7+3nUVy3uXQEI6O1vd8Cnx2LKk=; b=kvgoo1AWJ53ectZxNh7vumo7uHVF3ezzA+dmS6OCiyHy7q38adiyo8Mt48b9s1ecuS 8vbgSWAHi7F66ZbJb0OnnHkka0SZfIdhx44ptJvkStf7KSPyjOUktnOEWU+P5uVTHP64 eN+AH0Y198g5GhXwzgWWBTwbfohtVJT/rFQhRmBXLkxVDGhPtni3s7vOLmfSoppPuiMS fw+6xL0t8nIg9W/VqAlmea2Xi/QAMj43r70NCnqPKdZOQ+k2pXu+G5fUMaRe8zFdt2fk JWWQc2NJ/zMPTaMg9M5+VHQpiaQGfqqosa4YWPSG3qztsQIxZrsszWUCVKNg2vbMMWht a6XA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EAhatab0HAVyw+PnT7+3nUVy3uXQEI6O1vd8Cnx2LKk=; b=VodJwO5VrpHBWo6CXJrvp8/OUfLW0tEy8et2z4f3EYonLyifIAxXIRIOF+SXb1gxYI JET0G+pv8yWAnQgAd3EqIUKLXk6nvVAMJ0Z2FRJ7aGX0ENXMWjm3azjYI6zizhLQtiS+ E5drBA6ANIXUo7LcZqc7+2M1IAibPGyoGQ8Jc3qYf/NGeoeGQhYnwyrgi2+KDazWr/TT muw16Z8HdnmUJw7j/vaGAqKaaxFj8uZIdRZypklhTRCReaLdmKUgmJ1l+8TDqWPTtfq+ lpjXCPE92T+fWqY6/zJpyfJ2kCVILUPErvYZyKl2AFFcV4mNstVic1LTfXvTPgRhVEZN Rfcg== X-Gm-Message-State: APjAAAXqAOOningNHymZ+SZti3eu8oQ+75WCnPUVY0BfpcwJjzYZ8U12 wG+fihKIXNxpgBSstjcOUmscZjnFyTdJiZYL8syteg== X-Received: by 2002:ab0:234e:: with SMTP id h14mr10788176uao.25.1560808781025; Mon, 17 Jun 2019 14:59:41 -0700 (PDT) MIME-Version: 1.0 References: <20190617135636.GC1367@arrakis.emea.arm.com> <20190617171813.GC34565@arrakis.emea.arm.com> In-Reply-To: <20190617171813.GC34565@arrakis.emea.arm.com> From: Evgenii Stepanov Date: Mon, 17 Jun 2019 14:59:29 -0700 Message-ID: Subject: Re: [PATCH v17 03/15] arm64: Introduce prctl() options to control the tagged user addresses ABI To: Catalin Marinas 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 Content-Type: text/plain; charset="UTF-8" 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 10:18 AM Catalin Marinas wrote: > > 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? I think it would be fine. > 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