From patchwork Tue Jun 26 02:16:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ram Pai X-Patchwork-Id: 934659 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 41F8w76bhzz9rxs for ; Tue, 26 Jun 2018 12:23:03 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uj9z54sr"; 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 41F8w753CzzF1Hw for ; Tue, 26 Jun 2018 12:23:03 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=us.ibm.com 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="uj9z54sr"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400d:c0d::241; helo=mail-qt0-x241.google.com; envelope-from=ram.n.pai@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=us.ibm.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="uj9z54sr"; dkim-atps=neutral Received: from mail-qt0-x241.google.com (mail-qt0-x241.google.com [IPv6:2607:f8b0:400d:c0d::241]) (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 41F8mg6kLPzF1GF for ; Tue, 26 Jun 2018 12:16:35 +1000 (AEST) Received: by mail-qt0-x241.google.com with SMTP id 92-v6so9409392qta.11 for ; Mon, 25 Jun 2018 19:16:35 -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=8uFCjgOTdLrRHP5Nua0y7gmsuchYxyVLwu96giaKlS4=; b=uj9z54srIsz1CvJNDo5Mq5UHMcIXK2yHRgrqPvd14b4PQfklCIlcaXXa47hiKkrJLD bXoeQPWGPmd7D15N7NNFrhPNyC7MMCjQOFNZK5BWOeuBDtSipcFpcXNBA0vqAfTDrpgN EpVk+luAPgu3xkEGxH3JKGhq7ZWg45rJXspb5EHf0bX7Y1i1fHiTGgHNek2RBezlUqix Epdx0RO/g4RBHHV+ypwXR60VNa5a2oZE6lkqUzTQJB4f2CB/SR6PrIhuq43XgAgr8ze1 aAnLi0TdkYbJuxorWDy1K6vwAkOruSL02Oz9OjowJp98ME5Q2Ay8EMwuLlaAOgMqGk5r 2nLg== 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=8uFCjgOTdLrRHP5Nua0y7gmsuchYxyVLwu96giaKlS4=; b=Dq3nkUdKzDwNJ0PqW7/mDybZEv4u3wKxpBXgP8htIKmHuTbD7kB6vvpHEic7qbaWmR W5qulPhdJqAhedfCooHNVI5jLp8Hl05VfJ+IjzldUpjjUFrutAqzVFDJ1W/BcWWrTVM+ oRey0SAbELpN7jczYsQql3PYA4vUzkp9WaLy9TqipzHQWUGsBH94K4dXU60dl65ZHn4D 0u6EA6zarhGqW5Zevnn6+ChLJScSO2IvMOnX1KnM/G1eDLvSpzgamQVbs790gCIzB7O8 wICrafPnL60HQhBWZkI5bjc/LOd6bMCNshjre113k9xaxcTqJg6h6kmLckDtw/poPGMF hmLw== X-Gm-Message-State: APt69E2o2+d6E9B4XnkbOzvDK4/QA+XjJavnlZUPd7i3ddsGQYRBmvWr 4Fh77enCN18oAd0KHgFv9kc= X-Google-Smtp-Source: AAOMgpckWY6gKtFMrhuR4l0GUFzvBk6JNHzltspjSmRWBkTBSO9WsngTzNI87E2sfUKaD4xJM2ZkYw== X-Received: by 2002:a0c:8ec8:: with SMTP id y8-v6mr9863197qvb.132.1529979393503; Mon, 25 Jun 2018 19:16:33 -0700 (PDT) Received: from localhost.localdomain ([170.225.9.142]) by smtp.gmail.com with ESMTPSA id q49-v6sm445594qtc.33.2018.06.25.19.16.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 19:16:33 -0700 (PDT) From: Ram Pai To: mpe@ellerman.id.au Subject: [PATCH 1/2] powerpc/core-pkeys: execute-permission on keys are disabled by default Date: Mon, 25 Jun 2018 19:16:15 -0700 Message-Id: <1529979376-7292-3-git-send-email-linuxram@us.ibm.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1529979376-7292-1-git-send-email-linuxram@us.ibm.com> References: <1529979376-7292-1-git-send-email-linuxram@us.ibm.com> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: fweimer@redhat.com, Ulrich.Weigand@de.ibm.com, linuxram@us.ibm.com, mhocko@kernel.org, bauerman@linux.vnet.ibm.com, msuchanek@suse.de, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Only when the key is allocated, its permission are enabled. Signed-off-by: Ram Pai Reviewed-by: Thiago Jung Bauermann --- tools/testing/selftests/powerpc/ptrace/core-pkey.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/tools/testing/selftests/powerpc/ptrace/core-pkey.c b/tools/testing/selftests/powerpc/ptrace/core-pkey.c index 36bc312..b353d86 100644 --- a/tools/testing/selftests/powerpc/ptrace/core-pkey.c +++ b/tools/testing/selftests/powerpc/ptrace/core-pkey.c @@ -140,6 +140,10 @@ static int child(struct shared_info *info) if (disable_execute) info->iamr |= 1ul << pkeyshift(pkey1); + else + info->iamr &= ~(1ul << pkeyshift(pkey1)); + info->iamr &= ~(1ul << pkeyshift(pkey2) | 1ul << pkeyshift(pkey3)); + info->uamor |= 3ul << pkeyshift(pkey1) | 3ul << pkeyshift(pkey2);