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=-0.7 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham 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 C4848C31E49 for ; Thu, 13 Jun 2019 16:16:08 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9DA3B2177E for ; Thu, 13 Jun 2019 16:16:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kxOKhMne" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9DA3B2177E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date: Message-ID:From:References:To:Subject:Reply-To:Content-ID:Content-Description :Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=od9WLy4XC0QsbrcaXeP3KkudSANzVBReHryRAJBaPC0=; b=kxOKhMne6kZCIg uVxeXapB0+lgZOjzHxBOwcT6BUquHT4R2KuKXJpqaxJxzRDaHQuE0BAZYO86R/0GD+ga0DTVrMZFS LDifUHxU4wlGaNguxBl18wTli4m6eNOP7kzXBJVPHvFoe5ezPYjbNOpzp4RnJoT0+o98HJESwBV2e bpWazNHPf0lCkK/TG9SvzBiRUEZ+OAT7/8QyE0iOfLsRL7+tIDzzJ4yCren52RFGZTMbozOYwQuqX MFSnVnFwL5V55ONaiUDUgrAaAl2Q9IzUBONtqPRAfr5Qq/V/ZwzOXLchabv82W4RSz28RwDXrd9mE MJ7IKdjTrKx4FVnUd0kw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hbSOV-0003ei-BE; Thu, 13 Jun 2019 16:16:07 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.92 #3 (Red Hat Linux)) id 1hbSOS-0003eJ-Nl for linux-arm-kernel@lists.infradead.org; Thu, 13 Jun 2019 16:16:06 +0000 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 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-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190613_091604_868946_EE69C24C X-CRM114-Status: GOOD ( 20.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , kvm@vger.kernel.org, Christian Koenig , Szabolcs Nagy , Will Deacon , dri-devel@lists.freedesktop.org, Kostya Serebryany , Khalid Aziz , Lee Smith , linux-kselftest@vger.kernel.org, Jacob Bramley , Leon Romanovsky , linux-rdma@vger.kernel.org, amd-gfx@lists.freedesktop.org, Christoph Hellwig , Jason Gunthorpe , Dmitry Vyukov , Dave Martin , Evgeniy Stepanov , linux-media@vger.kernel.org, Kees Cook , Ruben Ayrapetyan , Andrey Konovalov , Kevin Brodsky , Alex Williamson , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, Greg Kroah-Hartman , Felix Kuehling , linux-kernel@vger.kernel.org, Jens Wiklander , Ramana Radhakrishnan , Alexander Deucher , Andrew Morton , enh , Robin Murphy , Yishai Hadas , Luc Van Oostenryck Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel