Received: by 10.223.164.202 with SMTP id h10csp853833wrb; Mon, 6 Nov 2017 17:24:20 -0800 (PST) X-Google-Smtp-Source: ABhQp+QeW5EwilwMfotM7y7ms3QSEfcbjc0SeYFLq7Q1pMP8kV8ny877XfcDW2eZ3EG6m90Q0nrZ X-Received: by 10.84.240.2 with SMTP id y2mr16353501plk.372.1510017860358; Mon, 06 Nov 2017 17:24:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510017860; cv=none; d=google.com; s=arc-20160816; b=ZkmtgXTn4aJADHj1oVaNefRSJ5dXvAiQtWsrBRSJPciRZpPx1JhrAls4FbMGq4crH+ CSWsqyVz999cvx29JXysOUVs/4wKB8svuMjtrY2fPbnT5Q/Y9QK1HflUZMQ11rkkzjp0 W2Y4gBWY2QB+P7AmMN1/3dq16VKHqL3MQUbGBeQF7p5sBqzKasTJidSGXaoa8mpEW7Bw sU0HOsebVdWUYGNbMEoXTRx43u9liRynOUrOgQKmt29E9MXTpEKizU0McQqiasYrli31 XOj9tvMZtlaDH75qXUFyU3+jdAq/r68ggeIMnNMmJJPNk1jrRoA3k5bMqq2zJiNEh6Cf TBgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=8htCobvmHSjmolYXkYgtcXxhpju2y/lQvO+vqPt+Vbw=; b=wlfIcGNt8JNZZVWTZq0UL5dv3CCwv/QXB2suw5tcK+1MYR+GkR3Y/Gj0FEXeCGtqWJ HriC2AkAGX48V9wustIAgpA0reL+Lss/sNlu8/Ygnwg5MGW+t0wObhJomU2i1CiEjtMX MnFG5nU9lDJxalgo3Zqw4LmG4T1+u/GSScrDRUqLio+2ZHCbwy7agSV0fC+fLanqBA5g zGx27htSsmfeOqGrTqvMktbkfrMEkMDAsYMLcQw+tWAoJs4Elqz8F7zSIXg3MKKsFeyt KZsCuBNLjva1HvdKAZU9S2OX7IUiR4SK43qrTWQbIb+u+FgbXDKbAkNqXIUEZymnCNFq K8kw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u27si35718pgo.729.2017.11.06.17.24.07; Mon, 06 Nov 2017 17:24:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965141AbdKGBWe (ORCPT + 94 others); Mon, 6 Nov 2017 20:22:34 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:36896 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752700AbdKGBWa (ORCPT ); Mon, 6 Nov 2017 20:22:30 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id vA71JYaM129626 for ; Mon, 6 Nov 2017 20:22:29 -0500 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0b-001b2d01.pphosted.com with ESMTP id 2e31y4u4sj-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 06 Nov 2017 20:22:29 -0500 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 6 Nov 2017 20:22:28 -0500 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 6 Nov 2017 20:22:23 -0500 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id vA71MNuJ34472144; Tue, 7 Nov 2017 01:22:23 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6CC5F112056; Mon, 6 Nov 2017 20:21:50 -0500 (EST) Received: from ram.oc3035372033.ibm.com (unknown [9.85.193.131]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTPS id 80789112051; Mon, 6 Nov 2017 20:21:48 -0500 (EST) Date: Mon, 6 Nov 2017 17:22:18 -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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87efpbm706.fsf@mid.deneb.enyo.de> User-Agent: Mutt/1.5.20 (2009-12-10) X-TM-AS-GCONF: 00 x-cbid: 17110701-0048-0000-0000-0000020161A0 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008022; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000239; SDB=6.00942191; UDB=6.00475253; IPR=6.00722479; BA=6.00005674; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017888; XFM=3.00000015; UTC=2017-11-07 01:22:27 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17110701-0049-0000-0000-00004318E194 Message-Id: <20171107012218.GA5546@ram.oc3035372033.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-11-06_08:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 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-1711070017 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > How do you deal with the key reuse problem? Is it the same as x86-64, > where it's quite easy to accidentally grant existing threads access to > a just-allocated key, either due to key reuse or a changed init_pkru > parameter? I am not sure how on x86-64, two threads get allocated the same key at the same time? the key allocation is guarded under the mmap_sem semaphore. So there cannot be a race where two threads get allocated the same key. Can you point me to the issue, if it is already discussed somewhere? As far as the semantics is concerned, a key allocated in one thread's context has no meaning if used in some other threads context within the same process. The app should not try to re-use a key allocated in a thread's context in some other threads's context. > > 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. > > > > I wonder if it's possible to fix some of these things before the exact > semantics of these interfaces are set in stone. Will try. RP From 1583357648778916962@xxx Mon Nov 06 22:32:03 +0000 2017 X-GM-THRID: 1583309178351971083 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread