From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754009AbcHAPAU (ORCPT ); Mon, 1 Aug 2016 11:00:20 -0400 Received: from www.sr71.net ([198.145.64.142]:45129 "EHLO blackbird.sr71.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752292AbcHAPAM (ORCPT ); Mon, 1 Aug 2016 11:00:12 -0400 Subject: Re: [PATCH 08/10] x86, pkeys: default to a restrictive init PKRU To: Vlastimil Babka , linux-kernel@vger.kernel.org References: <20160729163009.5EC1D38C@viggo.jf.intel.com> <20160729163021.F3C25D4A@viggo.jf.intel.com> Cc: x86@kernel.org, linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, luto@kernel.org, mgorman@techsingularity.net, dave.hansen@linux.intel.com, arnd@arndb.de From: Dave Hansen Message-ID: <579F6380.2070600@sr71.net> Date: Mon, 1 Aug 2016 07:58:08 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/01/2016 07:42 AM, Vlastimil Babka wrote: > On 07/29/2016 06:30 PM, Dave Hansen wrote: >> This does not cause any practical problems with applications >> using protection keys because we require them to specify initial >> permissions for each key when it is allocated, which override the >> restrictive default. > > Here you mean the init_access_rights parameter of pkey_alloc()? So will > children of fork() after that pkey_alloc() inherit the new value or go > default? Hi Vlastimil, Yes, exactly, the initial permissions are provided via pkey_alloc()'s 'init_access_rights' argument. Do you mean fork() or clone()? In both cases, we actually copy the FPU state from the parent, so children always inherit the state from their parent which contains the permissions set by the parent's calls to pkey_alloc(). From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dave Hansen Subject: Re: [PATCH 08/10] x86, pkeys: default to a restrictive init PKRU Date: Mon, 1 Aug 2016 07:58:08 -0700 Message-ID: <579F6380.2070600@sr71.net> References: <20160729163009.5EC1D38C@viggo.jf.intel.com> <20160729163021.F3C25D4A@viggo.jf.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: owner-linux-mm@kvack.org To: Vlastimil Babka , linux-kernel@vger.kernel.org Cc: x86@kernel.org, linux-api@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, torvalds@linux-foundation.org, akpm@linux-foundation.org, luto@kernel.org, mgorman@techsingularity.net, dave.hansen@linux.intel.com, arnd@arndb.de List-Id: linux-api@vger.kernel.org On 08/01/2016 07:42 AM, Vlastimil Babka wrote: > On 07/29/2016 06:30 PM, Dave Hansen wrote: >> This does not cause any practical problems with applications >> using protection keys because we require them to specify initial >> permissions for each key when it is allocated, which override the >> restrictive default. > > Here you mean the init_access_rights parameter of pkey_alloc()? So will > children of fork() after that pkey_alloc() inherit the new value or go > default? Hi Vlastimil, Yes, exactly, the initial permissions are provided via pkey_alloc()'s 'init_access_rights' argument. Do you mean fork() or clone()? In both cases, we actually copy the FPU state from the parent, so children always inherit the state from their parent which contains the permissions set by the parent's calls to pkey_alloc(). -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org