From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk0-f198.google.com (mail-qk0-f198.google.com [209.85.220.198]) by kanga.kvack.org (Postfix) with ESMTP id A37916B049A for ; Thu, 17 May 2018 06:11:18 -0400 (EDT) Received: by mail-qk0-f198.google.com with SMTP id 65-v6so1194750qkl.11 for ; Thu, 17 May 2018 03:11:18 -0700 (PDT) Received: from mx1.redhat.com (mx3-rdu2.redhat.com. [66.187.233.73]) by mx.google.com with ESMTPS id d88-v6si5065602qkh.133.2018.05.17.03.11.17 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 May 2018 03:11:18 -0700 (PDT) Subject: Re: [PATCH] pkeys: Introduce PKEY_ALLOC_SIGNALINHERIT and change signal semantics References: <57459C6F-C8BA-4E2D-99BA-64F35C11FC05@amacapital.net> <6286ba0a-7e09-b4ec-e31f-bd091f5940ff@redhat.com> <20180503021058.GA5670@ram.oc3035372033.ibm.com> <927c8325-4c98-d7af-b921-6aafcf8fe992@redhat.com> <314e1a48-db94-9b37-8793-a95a2082c9e2@redhat.com> <20180516203534.GA5479@ram.oc3035372033.ibm.com> From: Florian Weimer Message-ID: <9c7b1c17-5c0e-11aa-0803-a0f503087b37@redhat.com> Date: Thu, 17 May 2018 12:11:15 +0200 MIME-Version: 1.0 In-Reply-To: <20180516203534.GA5479@ram.oc3035372033.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 Cc: Andy Lutomirski , Dave Hansen , Linux-MM , Linux API , linux-x86_64@vger.kernel.org, linux-arch , X86 ML , linuxppc-dev On 05/16/2018 10:35 PM, Ram Pai wrote: > So let me see if I understand the overall idea. > > Application can allocate new keys through a new syscall > sys_pkey_alloc_1(flags, init_val, sig_init_val) > > 'sig_init_val' is the permission-state of the key in signal context. I would keep the existing system call and just add a flag, say PKEY_ALLOC_SETSIGNAL. If the current thread needs different access rights, it can set those rights just after pkey_alloc returns. There is no race that matters here, I think. Thanks, Florian