From patchwork Tue Jun 26 02:16:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ram Pai X-Patchwork-Id: 934660 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 41F8ym2X6lz9rxs for ; Tue, 26 Jun 2018 12:25:20 +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="QJK7qG1Z"; 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 41F8ym0bGBzF1Hp for ; Tue, 26 Jun 2018 12:25:20 +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="QJK7qG1Z"; 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="QJK7qG1Z"; 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 41F8mj53sRzF0wq for ; Tue, 26 Jun 2018 12:16:37 +1000 (AEST) Received: by mail-qt0-x241.google.com with SMTP id l10-v6so13887433qtj.0 for ; Mon, 25 Jun 2018 19:16:37 -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=l+CWLtD32Qyj9/vM8f7fvO+uRhXBr+4nyD5332VOexg=; b=QJK7qG1ZUsunD+zNyg32EdiJM61Y6DKIQAJ6ATDjf9Qzt0NjQ1PPEU5cpFowe4c6eA H3ws1eJzf9J8gB9ETf7sn7kb6R7S6rMSiD+ryRDWPpno2PqMPFI2PagvPGuD1r1ZW05d oSaGQVpkWUajlAysAGRyXEcdZwaKgIruMkv9C+hMJ1omCn81ns26ziWIBgWB/5AvJ/sy sEY2iGUqtZ9bUXlxSB1pX8LxFJ/0iVk0z1KXyA8YUkF9Rygs884O7aZu1ecXmedBKTwo SGbsN+ydyK156qMfLIkZu8qtZRhoYRFqMWlignGezPZTGiwNpgSyZnpPbYCV52JZYnYq eUig== 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=l+CWLtD32Qyj9/vM8f7fvO+uRhXBr+4nyD5332VOexg=; b=CvArWc1x1Z1DQjquuuhy1sd6QVq4o7Fj5hX9LPI1812oIG9TeWjf3ei0Oj+3KuaM8l 3yZY6n5ZmESHjSYfdCbAsf95RgiG45JDTjGcNKXMYG3gVX2rZ86M3luzsBQH463avyCL 1WUvvbU/CloVtYhrcv6NTWmmNiGs2zPWfJyhFmyDCetwvjL6NZd3PXZCz19XIS0k8EJH A8DGUjVzPvS6gkpcAmTUGEinyVHnXYPhbRVuxdB/2TSmmK503ODxTpHfqU/9KKXCJRfU HE3+CtOrX/1Vljhg9p71gWnFSvFkMdP7L2ZQjfM+JzyRzTJKqEEOV+YpzbyhLwwbJkz1 AvqA== X-Gm-Message-State: APt69E1CSwppwF9VS+7YXIgVhxk/GED442coieEzS09C4t/DY9U128Xr B618qeaEEgvt9GkUaFzzOkc= X-Google-Smtp-Source: AAOMgpfaQVcObsy7a0Z0raGbGWxRv3fdmqdE2UyzkLQgpMkNc7WV6GvKYWJhoa32REe16xh1maI6TQ== X-Received: by 2002:a0c:b44a:: with SMTP id e10-v6mr11175961qvf.140.1529979395576; Mon, 25 Jun 2018 19:16:35 -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.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 19:16:35 -0700 (PDT) From: Ram Pai To: mpe@ellerman.id.au Subject: [PATCH 2/2] powerpc/ptrace-pkeys: execute-permission on keys are disabled by default Date: Mon, 25 Jun 2018 19:16:16 -0700 Message-Id: <1529979376-7292-4-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" The test case assumes execute-permissions of unallocated keys are enabled by default. Signed-off-by: Ram Pai Reviewed-by: Thiago Jung Bauermann --- .../testing/selftests/powerpc/ptrace/ptrace-pkey.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c b/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c index 5cf631f..559c6cb 100644 --- a/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c +++ b/tools/testing/selftests/powerpc/ptrace/ptrace-pkey.c @@ -104,6 +104,11 @@ static int child(struct shared_info *info) if (disable_execute) info->expected_iamr |= 1ul << pkeyshift(pkey1); + else + info->expected_iamr &= ~(1ul << pkeyshift(pkey1)); + info->expected_iamr &= ~(1ul << pkeyshift(pkey2) | 1ul << pkeyshift(pkey3)); + + info->expected_uamor |= 3ul << pkeyshift(pkey1) | 3ul << pkeyshift(pkey2);