From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D8CCEC433DF for ; Wed, 14 Oct 2020 05:26:20 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 70B6B214D8 for ; Wed, 14 Oct 2020 05:26:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="QpOSeu39"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="b/lDTYM5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 70B6B214D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:From:Subject:Mime-Version:Message-Id:Date: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=mGyskwVjTDWNSOQzjZo2q+wteLZD88jtWnQZ9sOG8Sc=; b=QpOSeu39kPAMKHdKE24soSeVvu pHhymU+tzgSnmSpID1fz9gpWa+wGFFDXhcFS/B3cd6TF3fqwF3lJSt3Mx0XCQKARmh17hdEv7MLln 0WG6WUT1lKCSyJ2sEVgB9F/sFQMzphTy+pGrrBv9XZnWOU8iW5yTBRG/+E/EyLMrgMYmfU1CJ38sn bCmW/LlgPw9SgKk55f9dRF9+PmUBhNrBVyGHWS+BSvYIFh1qhFk4AP4K5z1TMpwQcPFujP1y3DxxK ra9YXf8bFwrKYUO2T6hx5KbpzAoU6wQJa5Zqu0MPIV/Kp+YbTHvL6ne8adfljBarScXibX5pYFrb0 neJOXZSA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSZHK-0007ul-LS; Wed, 14 Oct 2020 05:24:46 +0000 Received: from mail-qt1-x849.google.com ([2607:f8b0:4864:20::849]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSZHH-0007uF-2k for linux-arm-kernel@lists.infradead.org; Wed, 14 Oct 2020 05:24:44 +0000 Received: by mail-qt1-x849.google.com with SMTP id y53so1554471qth.2 for ; Tue, 13 Oct 2020 22:24:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=Yt/OY0iBjDBLGJdFWMyELvTxy3zFHBVx43/h3cuBWxs=; b=b/lDTYM5rXYDM6n2yPlypQFsO2hvSQ3AaI+126vexGPg6HE3xhZKUMWBnHx6xbF5oL XfO52MEf1e9PuhvcNCUgE+7SPdZ6kD6rRsorIgIPox6akVDlCD1h4T8u3DrmFB5OwS14 BkEXfWa89Jzx2ke+Ds5teWTPt1m8oi/+zHVxIE6jCA6PrWPV5Vgm9CSV1xKa+r98DsoW LSbTwA7T7XL82cpmcFBbza0cpcHLarmfHuK4DzVsvI7NYOXpwL2OcG7yqVKYTX3jQxdG p0knPjeLf3UgYAGRat5UbCz8cRLcUY4pS05jIPMCKH4zTXvMLiuySw0pik1FmMrDE0Ud fu+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=Yt/OY0iBjDBLGJdFWMyELvTxy3zFHBVx43/h3cuBWxs=; b=WgcwffNrMLO/B1HvYy4p7fe4j+s42Jhfewxj3TVlywzcHCqtqhT7PX3GVWR0N8OZuT akIcAvwN2djw5mDBRpkWcTfsC4i6ggVpqHNTTWqk9BbRdu/KiQEANUIbuz9mR6yVtObJ FpeoeNsIHYNKxoX593ClJnYVh6Xx3ALETKA5dl3ONC8mFcxZ43AJMwEAoBStyqxq+B94 pfYCkGQY4/kkbMko3FclPIU4eC0LhZm6tcTUhCjnxma9r3zYVUwfF6NmhCisN8kFVa6t DYBbJBOFTzuhHRE5HeHLaR0z+InvjYkh+jbtphKjbJEPoPp9qS2xOVQOwM7C8tP7krcv bKkw== X-Gm-Message-State: AOAM532k+pU5FvxVZFKlV8sogxWhGbbSsSacSu7b7cyoyaZRWyDyApM9 UdWlj7dmx2ibG137XK91ZLuZP0A= X-Google-Smtp-Source: ABdhPJxk/qdVbwEYv/UVbMEz1B7QxJbcMI+TRQYAHdUmQriRZ5jpI+2qwaXqsm/CUfFkse2AyqKTXiM= X-Received: from pcc-desktop.svl.corp.google.com ([2620:15c:2ce:0:7220:84ff:fe09:385a]) (user=pcc job=sendgmr) by 2002:ad4:59cf:: with SMTP id el15mr3344935qvb.17.1602653079386; Tue, 13 Oct 2020 22:24:39 -0700 (PDT) Date: Tue, 13 Oct 2020 22:24:30 -0700 Message-Id: <20201014052430.11630-1-pcc@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.28.0.1011.ga647a8990f-goog Subject: [PATCH] arm64: reject prctl(PR_PAC_RESET_KEYS) on compat tasks From: Peter Collingbourne To: Kristina Martsenko , Vincenzo Frascino , Catalin Marinas , Will Deacon , Dave Martin X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201014_012443_159251_A3B9F163 X-CRM114-Status: GOOD ( 14.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Collingbourne , Linux ARM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org It doesn't make sense to issue prctl(PR_PAC_RESET_KEYS) on a compat task because the 32-bit instruction set does not offer PAuth instructions. For consistency with other 64-bit only prctls such as {SET,GET}_TAGGED_ADDR_CTRL, reject the prctl on compat tasks. Although this is a userspace-visible change, maybe it isn't too late to make this change given that the hardware isn't available yet and it's very unlikely that anyone has 32-bit software that actually depends on this succeeding. Link: https://linux-review.googlesource.com/id/Ie885a1ff84ab498cc9f62d6451e9f2cfd4b1d06a Signed-off-by: Peter Collingbourne --- arch/arm64/kernel/pointer_auth.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm64/kernel/pointer_auth.c b/arch/arm64/kernel/pointer_auth.c index 1e77736a4f66..245c3ee97ed8 100644 --- a/arch/arm64/kernel/pointer_auth.c +++ b/arch/arm64/kernel/pointer_auth.c @@ -1,5 +1,6 @@ // SPDX-License-Identifier: GPL-2.0 +#include #include #include #include @@ -17,6 +18,9 @@ int ptrauth_prctl_reset_keys(struct task_struct *tsk, unsigned long arg) if (!system_supports_address_auth() && !system_supports_generic_auth()) return -EINVAL; + if (is_compat_task()) + return -EINVAL; + if (!arg) { ptrauth_keys_init_user(keys); return 0; -- 2.28.0.1011.ga647a8990f-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel