Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp2756268ybi; Mon, 17 Jun 2019 10:05:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqwMvIERlTG6Q/eATjTZ3fDm+uoqxoWNQ8QziQ4zGg0syBkOAMZ45S0dPHm3YZtPG9JIZGL1 X-Received: by 2002:a17:902:a60d:: with SMTP id u13mr40423561plq.144.1560790745329; Mon, 17 Jun 2019 09:59:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560790745; cv=none; d=google.com; s=arc-20160816; b=QFM5O135lX4+XC+7Cxe7YG9z1uuyWmu4B7ziWPeiFz07crOHH2ZJLhQ9QTOHlcLxaH cbQ8K61VPq6ge0+XY2cFhQ6Nxy3faAzZjfg0HrzSvo3E3Al8VBaV6avQcSL2x4CJp+pM ug63n6Cu3F4xgYv/ZWKnDbncW67BA9haGHmqG1tb3T17vzuVIwBvrmPU3RCRSAuPHbF0 R2wjLRxX+xU7evoLTndgj7Jbgqzt9CJvvCiusgcVyNFILzov/5eMYx4w++DnRzi240zd JfqrnTMZeUKvPJsgUvqGl6SF8WfuLG4sOZFTmVmnA3iW/Wx7hgKUkjGXVQwiucfu+p+A hAQQ== 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=retltkRYeaxJ6adF3YGzOCqdGSJ+TnMcYlKByHm/5DU=; b=ApU1yzfXaX8P7bBG1qhPeRWFydFE5zuV2EZ3KxPmazw2yIdRKfrssuIQhAIrRIgC2V Ha11bz2vvx+KvBxQprL9arzY9FbRnsd38EwgMJoL2h5WFrXASsbsrK1lYeh0Quv/+asP Ra673WFM1CWVvPPRJ61cEPw+vzmyfWvISPwBsPtkCBDi1ModVi2r//4WJHwI87j2BJ4U 3C9QyHMJNyh5OAi3/za3Wp+S9Hr+TZON1GcxZX5bMr92EIjfZQvpXu5u/6s8F1lx6FNg CoqcHcnn/8xD3iiT1WByVVwk3mT+Q/ZD7laJJl689CxvE7j3wb9WTwaycWappMkNoKTm 1kuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=HM9XZcRH; 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 m63si11361018pgm.443.2019.06.17.09.58.50; Mon, 17 Jun 2019 09:59:05 -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=HM9XZcRH; 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 S1728487AbfFQQ5u (ORCPT + 99 others); Mon, 17 Jun 2019 12:57:50 -0400 Received: from mail-vs1-f68.google.com ([209.85.217.68]:44467 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728416AbfFQQ5u (ORCPT ); Mon, 17 Jun 2019 12:57:50 -0400 Received: by mail-vs1-f68.google.com with SMTP id v129so6545260vsb.11 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=FquSp0prAb2N0zXNAypsKQ1EZbdsq5eUIZX3XtdTHm2JsdNDrP3QKqKrh2Ut8wpduF sQXrIWYuG0cYXV9AojPEoXis8sBpRFHNVE+bWoU+XmEyFSNLFkiJTEWX+3DsFT/0tZH5 acoN7LNUNsxh6KOTV5N01stFae90NhbZv+SvWGlhz0ZzlY8Mv1e8E+VgBesiKyuYgvzW Li4kTZSiJwxv/GrBVyK9+LRUhNezjnNE3SVlY1YgPe45G5+3iWhyBx28Q1e21JZhix56 p2d19O/Al4KgJ10Y1jDhDWWupI1uMjBZVmPOeTtZ0xPVBeB18vEi6aSqFSqiTFmYrIGF MIOQ== X-Gm-Message-State: APjAAAVOF3ah+sGFpS5yoCqbZVW3yiT70S82ajzzmM4qGAxzrmLRQ55M ByWvYsdnRKJeqy+w/Ic7ZcvIG9i3G6a/wb4cQmjPAQ== 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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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.