From patchwork Thu Jun 22 01:39:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ram Pai X-Patchwork-Id: 779275 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 3wtRZ224Yfz9s3s for ; Thu, 22 Jun 2017 13:16:26 +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="ZY4CXx+f"; 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 3wtRZ15WTmzDvXY for ; Thu, 22 Jun 2017 13:16:25 +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="ZY4CXx+f"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-qt0-x243.google.com (mail-qt0-x243.google.com [IPv6:2607:f8b0:400d:c0d::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 3wtPR65lV2zDr2y for ; Thu, 22 Jun 2017 11:40:18 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="ZY4CXx+f"; dkim-atps=neutral Received: by mail-qt0-x243.google.com with SMTP id s33so348356qtg.3 for ; Wed, 21 Jun 2017 18:40: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=O2tZasXnDeHZsqT0+Lt7qzOKCnukxbSp65IJccbbJrU=; b=ZY4CXx+fCXAjodXwyGuLRxQTW09KmnpbljmWsLo2EInCfsUmuuZlRY3ks4CvMzJKwc duM9T/wEPZT50XRtzW6DDJQ/dHFmjOW4mz+ctcWOGr3FGOKm821RMjlkynG4a5ilYRmy njxvZ+jokLe8oMBYgZcq0GqpON26sO7PLLPM5NAhfxTp0k8eDDaT+GsoF5JAD86QiGs+ +38RgidtU357Myuqc6mwu1bf84mdVoTHvpWoULwRvWBeSn5K/Egwk0BVs+UfmhJjz8+4 FbLBFtoTlchpXpOPYYBGjua8xdHtvkjWXGUaumlK5vUAC4C+lOEeCoiX843Kv2e1iM0b i8Og== 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=O2tZasXnDeHZsqT0+Lt7qzOKCnukxbSp65IJccbbJrU=; b=oPB/0AbOPf66XJMkwchZNfadnBJC6PpvPGormbFQXasos4hPTxggAomMjfZ1dtUlJv 3MCpAgXAd3g/jssVPJP4NSJmWW1P/nYzgcbrAA1vsdiXW9Iy+yVrHze0dzjej3t5a3Qq cWGWuT78ffvcfc1jzufh6auuOM2F5+581zaoWOGgzJ5gY+YpSTfp6PjjCj4ECpoxwIn0 csdLfXXp7+iBJA6var2DKWhAE1R/Lj9fzB0c7N/fMZ5jlMP5l4NxxkCguOsEhpel1v2k aKIlDUXRUXn0K/5gVv/c0XkbBIgHkBNaNjWtW2QKnXMuU6omVxMRxzki3/ggMRsW1k2V HRmA== X-Gm-Message-State: AKS2vOzXhQyhzXTR3w0fdwBd0TT70TqkB2yF++Ni+lH8ZgeY8zfACYwW uW/nRmlMceAnU86NLMw= X-Received: by 10.237.39.135 with SMTP id a7mr120237qtd.164.1498095616718; Wed, 21 Jun 2017 18:40: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 45sm70785qtu.14.2017.06.21.18.40.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Jun 2017 18:40:16 -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 11/23] x86: key creation with PKEY_DISABLE_EXECUTE is disallowed Date: Wed, 21 Jun 2017 18:39:27 -0700 Message-Id: <1498095579-6790-12-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" x86 does not support disabling execute permissions on a pkey. Signed-off-by: Ram Pai --- arch/x86/kernel/fpu/xstate.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c index c24ac1e..d582631 100644 --- a/arch/x86/kernel/fpu/xstate.c +++ b/arch/x86/kernel/fpu/xstate.c @@ -900,6 +900,9 @@ int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, if (!boot_cpu_has(X86_FEATURE_OSPKE)) return -EINVAL; + if (init_val & PKEY_DISABLE_EXECUTE) + return -EINVAL; + /* Set the bits we need in PKRU: */ if (init_val & PKEY_DISABLE_ACCESS) new_pkru_bits |= PKRU_AD_BIT;