From patchwork Thu Jun 22 01:39:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ram Pai X-Patchwork-Id: 779274 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wtRX45fmnz9s72 for ; Thu, 22 Jun 2017 13:14:44 +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="sZjK70cR"; 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 3wtRX44gfxzDr4W for ; Thu, 22 Jun 2017 13:14:44 +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="sZjK70cR"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-qk0-x243.google.com (mail-qk0-x243.google.com [IPv6:2607:f8b0:400d:c09::243]) (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 3wtPR43xjJzDqlZ for ; Thu, 22 Jun 2017 11:40:16 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="sZjK70cR"; dkim-atps=neutral Received: by mail-qk0-x243.google.com with SMTP id r62so356704qkf.3 for ; Wed, 21 Jun 2017 18:40:16 -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=CMoARNXI5jlk6DYBRpXS9+xUff8BwPOfelAgzOJZXHg=; b=sZjK70cRBVvNIC03edTYw7h7GxJx6IWqa43FM5zEYsLJ4jczVWv4UYZGa3qGQvSwtR oABNvRnSIVNV31jzROMuTTGLsgWFQ3U+ZRvq+gyclcd9BXbWNt0jv4koffFDm4iIPaqU U2L8SNO4WAYqfk3c6bbspuPnpHGvsfF5IjMfowI6MrUKxrQTRL5cNrqr2N04g+CUnBUA UymWMu3mynnMfSrKDvi07MpXeI9ihedM48JHHi+1ALcRTdqWPaGt72Le9L2Pjw/2MZlO hCIJSDJF+uKYM4Ncquj42x8qdtADT5F5FkmDG7B1ijhPu/GlC7VskLYrYJAnbMaPP3Dc J7kw== 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=CMoARNXI5jlk6DYBRpXS9+xUff8BwPOfelAgzOJZXHg=; b=YmkOrdYTM+L4WSmxSMLejyz3WahV5SMyZ0lTeGe5rDsmS2SI9Z1I/+iv6u4aN/7AAC sraiyPY6jo3awFjK9/BQdGW/dIrzvDBr/3SoF4c8ihF4fLSAwrGe43SqMOgkKl4GB9BQ 6Vw4e4V/SlzlRUuyhf3L58I57h2r5JjjYf2+wik1ss4cUtqesfYZNAMQ41cVhJltefsw zrnFGD/mE4ucxmj3h9nBdxkCUKSPAQmbF8NewF6EpRhfT3x1MPECuiDgMSRGl/dmF877 ZDcxE+xshSmF6qfxEjxXDKxpqdww9OvYCgnOkbETfQ32UtAjwOSv2nJK1NyKDfmYwfRa JaUA== X-Gm-Message-State: AKS2vOxKNpQrDZgwt/SrQW0Uy6UnFp0+qIrlI4JB1HQ8jmaeg4CiOuS8 IW4DW5edb935Hz243XY= X-Received: by 10.55.45.198 with SMTP id t189mr128607qkh.108.1498095614383; Wed, 21 Jun 2017 18:40:14 -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 45sm70785qtu.14.2017.06.21.18.40.12 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Jun 2017 18:40:14 -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 v3 10/23] mm: provide the ability to disable execute on a key at creation Date: Wed, 21 Jun 2017 18:39:26 -0700 Message-Id: <1498095579-6790-11-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1498095579-6790-1-git-send-email-linuxram@us.ibm.com> References: <1498095579-6790-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 is PKEY_DISABLE_EXECUTE is specified. Signed-off-by: Ram Pai --- 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 */