Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7084704ybi; Thu, 13 Jun 2019 09:17:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqz3si42g+iUDWonSVghwM4H3C41GF+sOSOWkH1xvUQwuLZt/Its+oSgqPAYoZWWpp6IsmNa X-Received: by 2002:a17:902:728a:: with SMTP id d10mr86924749pll.90.1560442639958; Thu, 13 Jun 2019 09:17:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560442639; cv=none; d=google.com; s=arc-20160816; b=JbxHdwVDGV6jq0NY78Rd/XWGarsxW43/LzXq0RHc3WXxu4W8GzP50IHw2lMaJjh7ub L3UqCmVVuNriNspsmqd8KVBzRElgBjMS8NMjPsZCx07t6OembqULS+Ro3nDvptkknaQe iayJyiXfuic6faOD8WcNh83ze7hFq+awyLUlwXcw7wOZYdPuDPviQf9GQxaV5rmcR7LG deGG5sSFPCbKKqSba+1i9vT4TLY8YUSkreZ+R3ZkIzYVj+w6vc3aRVOviOoSjNgSiJyy 7kd5ik+HVIZCx0QplXDztrX+PE54xVtjeWB5B7gPZ3RL45qjdVeVb3bb2ivJyZtzZxSH b5HA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=z2PlpbYUAUgabvXSn4QjrWbHGEeXJXjoa6RlgSEKseQ=; b=xS67xN6zzm64M/TzwyI7YLdHGXj0U456s7dS5eNSOv+upS22PjKIkqnh+vWbCRznlF g1Wn/4EYnN10hv9Ip44m9V1kUP0GnClypUW3wS+3PewaQwkz0IrQHV188gZvj6W5+mqO /dO/czfhU6xMk2l7/B99g9GUeWJHPUgBZMgDko8cIoNLoCRDVe5gPD1azI75YaBzCbmi WOB57KeSyTDFJOKhLF+h+S2IQliuHfLxh7HCZwkYmpj2LtoJcoJ07eVRQIEP0xhp9Nz3 5j5FcTXonrQ0hDt9JlAXYzc3gKlB8JbSI3cQbAWCZPBLUcNnpmkjcrusXyUVK7+hWRR4 xZ3A== 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 e20si129604pgi.547.2019.06.13.09.17.04; Thu, 13 Jun 2019 09:17:19 -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 S2391906AbfFMQQG (ORCPT + 99 others); Thu, 13 Jun 2019 12:16:06 -0400 Received: from foss.arm.com ([217.140.110.172]:44920 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731160AbfFMQQF (ORCPT ); Thu, 13 Jun 2019 12:16:05 -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 12AAE367; Thu, 13 Jun 2019 09:16:04 -0700 (PDT) Received: from [10.1.196.72] (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id CB5643F694; Thu, 13 Jun 2019 09:15:58 -0700 (PDT) Subject: Re: [PATCH v17 03/15] arm64: Introduce prctl() options to control the tagged user addresses ABI To: Catalin Marinas Cc: Dave Martin , Andrey Konovalov , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-rdma@vger.kernel.org, linux-media@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, Mark Rutland , Szabolcs Nagy , Will Deacon , Kostya Serebryany , Khalid Aziz , Felix Kuehling , Jacob Bramley , Leon Romanovsky , Christoph Hellwig , Jason Gunthorpe , Evgeniy Stepanov , Kevin Brodsky , Kees Cook , Ruben Ayrapetyan , Ramana Radhakrishnan , Alex Williamson , Mauro Carvalho Chehab , Dmitry Vyukov , Greg Kroah-Hartman , Yishai Hadas , Jens Wiklander , Lee Smith , Alexander Deucher , Andrew Morton , enh , Robin Murphy , Christian Koenig , Luc Van Oostenryck References: <20190613111659.GX28398@e103592.cambridge.arm.com> <20190613153505.GU28951@C02TF0J2HF1T.local> <99cc257d-5e99-922a-fbe7-3bbaf3621e38@arm.com> <20190613155754.GX28951@C02TF0J2HF1T.local> From: Vincenzo Frascino Message-ID: Date: Thu, 13 Jun 2019 17:15:57 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20190613155754.GX28951@C02TF0J2HF1T.local> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 13/06/2019 16:57, Catalin Marinas wrote: > On Thu, Jun 13, 2019 at 04:45:54PM +0100, Vincenzo Frascino wrote: >> On 13/06/2019 16:35, Catalin Marinas wrote: >>> On Thu, Jun 13, 2019 at 12:16:59PM +0100, Dave P Martin wrote: >>>> On Wed, Jun 12, 2019 at 01:43:20PM +0200, Andrey Konovalov wrote: >>>>> + >>>>> +/* >>>>> + * Control the relaxed ABI allowing tagged user addresses into the kernel. >>>>> + */ >>>>> +static unsigned int tagged_addr_prctl_allowed = 1; >>>>> + >>>>> +long set_tagged_addr_ctrl(unsigned long arg) >>>>> +{ >>>>> + if (!tagged_addr_prctl_allowed) >>>>> + return -EINVAL; >>>> >>>> So, tagging can actually be locked on by having a process enable it and >>>> then some possibly unrelated process clearing tagged_addr_prctl_allowed. >>>> That feels a bit weird. >>> >>> The problem is that if you disable the ABI globally, lots of >>> applications would crash. This sysctl is meant as a way to disable the >>> opt-in to the TBI ABI. Another option would be a kernel command line >>> option (I'm not keen on a Kconfig option). >> >> Why you are not keen on a Kconfig option? > > Because I don't want to rebuild the kernel/reboot just to be able to > test how user space handles the ABI opt-in. I'm ok with a Kconfig option > to disable this globally in addition to a run-time option (if actually > needed, I'm not sure). > There might be scenarios (i.e. embedded) in which this is not needed, hence having a config option (maybe Y by default) that removes from the kernel the whole feature would be good, obviously in conjunction with the run-time option. Based on my previous review, if we move out the code from process.c in its own independent file when the Kconfig option is turned off we could remove the entire object from the kernel (this would remove the sysctl and let still the prctl return -EINVAL). These changes though could be done successively with a separate patch set, if the Kconfig is meant to be Y by default. -- Regards, Vincenzo