From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt0-f199.google.com (mail-qt0-f199.google.com [209.85.216.199]) by kanga.kvack.org (Postfix) with ESMTP id C18DC6B0005 for ; Fri, 9 Mar 2018 06:04:58 -0500 (EST) Received: by mail-qt0-f199.google.com with SMTP id d1so6530108qtn.12 for ; Fri, 09 Mar 2018 03:04:58 -0800 (PST) Received: from mx1.redhat.com (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id l11si590454qta.327.2018.03.09.03.04.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 09 Mar 2018 03:04:57 -0800 (PST) Subject: Re: [PATCH] x86, powerpc : pkey-mprotect must allow pkey-0 References: <1520583161-11741-1-git-send-email-linuxram@us.ibm.com> From: Florian Weimer Message-ID: Date: Fri, 9 Mar 2018 12:04:49 +0100 MIME-Version: 1.0 In-Reply-To: <1520583161-11741-1-git-send-email-linuxram@us.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Ram Pai , mpe@ellerman.id.au, mingo@redhat.com, akpm@linux-foundation.org Cc: linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org, dave.hansen@intel.com, benh@kernel.crashing.org, paulus@samba.org, khandual@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, bsingharora@gmail.com, hbabu@us.ibm.com, mhocko@kernel.org, bauerman@linux.vnet.ibm.com, ebiederm@xmission.com, corbet@lwn.net, arnd@arndb.de, msuchanek@suse.com, Ulrich.Weigand@de.ibm.com On 03/09/2018 09:12 AM, Ram Pai wrote: > Once an address range is associated with an allocated pkey, it cannot be > reverted back to key-0. There is no valid reason for the above behavior. mprotect without a key does not necessarily use key 0, e.g. if protection keys are used to emulate page protection flag combination which is not directly supported by the hardware. Therefore, it seems to me that filtering out non-allocated keys is the right thing to do. Thanks, Florian