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=-11.3 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=unavailable 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 4194EC31E5B for ; Mon, 17 Jun 2019 16:57:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 170DA20652 for ; Mon, 17 Jun 2019 16:57:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="HM9XZcRH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728467AbfFQQ5u (ORCPT ); Mon, 17 Jun 2019 12:57:50 -0400 Received: from mail-vs1-f65.google.com ([209.85.217.65]:42240 "EHLO mail-vs1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726005AbfFQQ5u (ORCPT ); Mon, 17 Jun 2019 12:57:50 -0400 Received: by mail-vs1-f65.google.com with SMTP id 190so6569781vsf.9 for ; Mon, 17 Jun 2019 09:57:49 -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=retltkRYeaxJ6adF3YGzOCqdGSJ+TnMcYlKByHm/5DU=; b=HM9XZcRH7jNoUwKtDn/wkkMYYyg9wr6zjYQcvYAYvWF5M1tzrgs41DdFiwwTgvt1O5 KjOS0GHXaKxXHbuqb3yaHFY6s5m+GgG8jbRV5AKURRu+BUwOFgp4r3kAue00v9koQG1w A3M5l+cF/ibNvE8yJCY4E6+A4Wcv9UTKgrtukbJgSFBngoBXKyC/nUsbJSqEshzxgU7v OjkzG8cTM1db0z9+CHPRCzJf6yJOwQUirXZIKRWYCQ5D1XOdgX6CDWUq7ZrKtG2PzpGN +3DiSEl9lQXDncbHpzuwreL+mokGyGGK7aL+x6DR/HBeGpJarIMjtc91XuMaEVI3t0qt MUIA== 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=retltkRYeaxJ6adF3YGzOCqdGSJ+TnMcYlKByHm/5DU=; b=Jwfh2KxruZ9t8/dstnMOU8B9lgsuC1cTm9cQHPqc8LCXkW3MCy0tJBZ+LT5Lr6j+xc dqw1trMswKvrofu44y8h7PBSpqiK644mSxjdzzHj0jRp+jNKM3b3BTqjFz8UymbSLRKd 7XR2cz0u2rsJUBgS1FSB6sbFDb+40oeLpIhx1q0HbmDFRsVh0q2K4X09xT/OnS+4CX6G SIxsngamg/Eg7Q5i07Vh8Pl3en60iQ8i2nQOrtXaBLNg1KxcK6antK/05sC1hv5KFJam xCS7GDbqvf+Nyu38UyP1bnFnxdkY4ruDQmL0TrMNROjU8XHkuYPiPVS1PUlAI/1RQSNR FH3w== X-Gm-Message-State: APjAAAVRL8ydMLSRR/4qfHi6k8LdZNXnY2zbkxYUziWe5VEiZMhBNQN8 km5SQRYXGJtiC8yJHEeMzCegHM/wbXhJW7Bw0HP+vA== X-Google-Smtp-Source: APXvYqzrhGSVJ7DV/F7d51q9N5ZE/3Gdj+PUpdVhrLQtXpA774FgTPlA9JMz0E4zBMsomoYTx9It+Pl+lwBwRCw5EpI= X-Received: by 2002:a67:de99:: with SMTP id r25mr60881073vsk.215.1560790668543; Mon, 17 Jun 2019 09:57:48 -0700 (PDT) MIME-Version: 1.0 References: <20190617135636.GC1367@arrakis.emea.arm.com> In-Reply-To: <20190617135636.GC1367@arrakis.emea.arm.com> From: Evgenii Stepanov Date: Mon, 17 Jun 2019 09:57:36 -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: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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.