From patchwork Tue Jun 27 10:11:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ram Pai X-Patchwork-Id: 781116 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wxhhg2Yhxz9s5L for ; Tue, 27 Jun 2017 20:18:27 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rJ70LZyN"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3wxhhg1Q55zDr2r for ; Tue, 27 Jun 2017 20:18:27 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rJ70LZyN"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-qt0-x244.google.com (mail-qt0-x244.google.com [IPv6:2607:f8b0:400d:c0d::244]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wxhYZ1KmczDr2m for ; Tue, 27 Jun 2017 20:12:18 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="rJ70LZyN"; dkim-atps=neutral Received: by mail-qt0-x244.google.com with SMTP id c20so3170981qte.0 for ; Tue, 27 Jun 2017 03:12:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Ms2j1NyWSs9PwTANJewLHrdNrlTwavbwe7SYc3tKQMk=; b=rJ70LZyNslgKN+YB9P2L6CMcvwiGFQAaffk0EhppGjPlxrevvmNP8ak+EeKG9A3o+9 NsyVbX3jgRUbMe6M/qe/NGZsnXvZXKmXVg1KrR/VLZUuQTdSOznDXDDhykVYL2tJp4d7 eVCgZsb/mcSeN3vpfs5lYiZOS9YX+wQwaz4FsbO0/xj82adpjxwo2Up4D8TqymAYuZvN 49IvxEpyTNn4nCIsydqf7E+6ryv2V2fbKoI5L6wu9f9meZQb12E6iHO9wD4v9nBTQu28 stQHofrlItmduNzZoiufxvAhhGntV+Z38zW9GKW4J62AQHYqhqvFQwLwgDmFIpaMK3Rn yxqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Ms2j1NyWSs9PwTANJewLHrdNrlTwavbwe7SYc3tKQMk=; b=Q+P3fNOd8FwhMeeq46CXvsnGGQ0dsNbkp2fHgf1gJvQA01gYYWgqws9d+frI/kJ5/J UkhAHWTOrV2s90EH/bKOgakl4LRhQFh4npGQFe7rzLtC+au3GtKhBI6ES7nwPbNIf9tM KHbg6MeNJthPU5SJRaG71wzCsCtMXptdg7QZPx8RhzQev2ylrg+oWhn65U5Z32OpR0wo +5nnNQC+VF9khJY0IpHmsx2w+GZkLske6cG1UMSTudTD5T5mkWrmavcsp2sO+pF84dwC Cy7fHss5gPM0KO5haxUXZXWZ97wA/V9lTc+YNmcvojPo0YSzysjXU2+tnFZ7RGf758LC xVzg== X-Gm-Message-State: AKS2vOzAZZrbNBIjIZXymfbKdOPdB6XTn/hSuZsRtho8Ui/LWznYuVWZ apmSIyr3RothBWLGjv8= X-Received: by 10.200.55.44 with SMTP id o41mr5408382qtb.120.1498558336168; Tue, 27 Jun 2017 03:12:16 -0700 (PDT) Received: from localhost.localdomain (50-39-103-96.bvtn.or.frontiernet.net. [50.39.103.96]) by smtp.gmail.com with ESMTPSA id n3sm1897140qkd.21.2017.06.27.03.12.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Jun 2017 03:12:15 -0700 (PDT) From: Ram Pai To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-mm@kvack.org, x86@kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [RFC v4 02/17] mm: ability to disable execute permission on a key at creation Date: Tue, 27 Jun 2017 03:11:44 -0700 Message-Id: <1498558319-32466-3-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1498558319-32466-1-git-send-email-linuxram@us.ibm.com> References: <1498558319-32466-1-git-send-email-linuxram@us.ibm.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: arnd@arndb.de, corbet@lwn.net, linuxram@us.ibm.com, dave.hansen@intel.com, mingo@redhat.com, paulus@samba.org, aneesh.kumar@linux.vnet.ibm.com, akpm@linux-foundation.org, khandual@linux.vnet.ibm.com Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Currently sys_pkey_create() provides the ability to disable read and write permission on the key, at creation. powerpc has the hardware support to disable execute on a pkey as well.This patch enhances the interface to let disable execute at key creation time. x86 does not allow this. Hence the next patch will add ability in x86 to return error if PKEY_DISABLE_EXECUTE is specified. Signed-off-by: Ram Pai Acked-by: Balbir Singh --- include/uapi/asm-generic/mman-common.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/uapi/asm-generic/mman-common.h b/include/uapi/asm-generic/mman-common.h index 8c27db0..bf4fa07 100644 --- a/include/uapi/asm-generic/mman-common.h +++ b/include/uapi/asm-generic/mman-common.h @@ -74,7 +74,9 @@ #define PKEY_DISABLE_ACCESS 0x1 #define PKEY_DISABLE_WRITE 0x2 +#define PKEY_DISABLE_EXECUTE 0x4 #define PKEY_ACCESS_MASK (PKEY_DISABLE_ACCESS |\ - PKEY_DISABLE_WRITE) + PKEY_DISABLE_WRITE |\ + PKEY_DISABLE_EXECUTE) #endif /* __ASM_GENERIC_MMAN_COMMON_H */