From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754943AbdKIWXn (ORCPT ); Thu, 9 Nov 2017 17:23:43 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46372 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753917AbdKIWXk (ORCPT ); Thu, 9 Nov 2017 17:23:40 -0500 Date: Thu, 9 Nov 2017 14:23:29 -0800 From: Ram Pai To: Florian Weimer Cc: mpe@ellerman.id.au, mingo@redhat.com, akpm@linux-foundation.org, corbet@lwn.net, arnd@arndb.de, linux-arch@vger.kernel.org, ebiederm@xmission.com, linux-doc@vger.kernel.org, x86@kernel.org, dave.hansen@intel.com, linux-kernel@vger.kernel.org, mhocko@kernel.org, linux-mm@kvack.org, paulus@samba.org, aneesh.kumar@linux.vnet.ibm.com, linux-kselftest@vger.kernel.org, bauerman@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org, khandual@linux.vnet.ibm.com Subject: Re: [PATCH v9 00/51] powerpc, mm: Memory Protection Keys Reply-To: Ram Pai References: <1509958663-18737-1-git-send-email-linuxram@us.ibm.com> <87efpbm706.fsf@mid.deneb.enyo.de> <20171107012218.GA5546@ram.oc3035372033.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171107012218.GA5546@ram.oc3035372033.ibm.com> User-Agent: Mutt/1.5.20 (2009-12-10) X-TM-AS-GCONF: 00 x-cbid: 17110922-0040-0000-0000-000003C01ED9 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008040; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000239; SDB=6.00943570; UDB=6.00476079; IPR=6.00723853; BA=6.00005682; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017942; XFM=3.00000015; UTC=2017-11-09 22:23:38 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17110922-0041-0000-0000-000007B539CB Message-Id: <20171109222329.GB5656@ram.oc3035372033.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-09_10:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1711090299 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 06, 2017 at 05:22:18PM -0800, Ram Pai wrote: > On Mon, Nov 06, 2017 at 10:28:41PM +0100, Florian Weimer wrote: > > * Ram Pai: > > > > > Testing: > > > ------- > > > This patch series has passed all the protection key > > > tests available in the selftest directory.The > > > tests are updated to work on both x86 and powerpc. > > > The selftests have passed on x86 and powerpc hardware. > > ....snip.... > > What about siglongjmp from a signal handler? > > On powerpc there is some relief. the permissions on a key can be > modified from anywhere, including from the signal handler, and the > effect will be immediate. You dont have to wait till the > signal handler returns for the key permissions to be restore. > > also after return from the sigsetjmp(); > possibly caused by siglongjmp(), the program can restore the permission > on any key. > > Atleast that is my theory. Can you give me a testcase; if you have one > handy. > > > > > > > reading through the bug report, you mention that the following "The application may not be able to save and restore the protection bits for all keys because the kernel API does not actually specify that the set of keys is a small, fixed set." What exact kernel API do you need? This patch set exposes the total number of keys and max keys, through sysfs. https://marc.info/?l=linux-kernel&m=150995950219669&w=2 Is this sufficient? or do you need something else? RP