From patchwork Thu Dec 3 07:51:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Collingbourne X-Patchwork-Id: 11948093 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=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,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 AE0FDC64E7B for ; Thu, 3 Dec 2020 07:52:27 +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 41D5B20BED for ; Thu, 3 Dec 2020 07:52:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 41D5B20BED 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=6HA7WgvtNrFBfwBFu01s0hXmyGzRoOydamk9h8xS3dk=; b=y/l4BGObtlvA3bUuYC6zEq28ik X8HDiOEQYgbWO9Fdy8o5tNKpeZpPiG657e6PJfw9ywf8uDrJJXdWJDK9o3C3yDWXH+OBseXBz392x 68byc+hl5MHvrs0WlbiDjGLGt0F1z8W2PM36pZ2XW2AQU8BqRG5CysKgyYvVUnJ7V30Xy5xd4K+Ll eswuoynq/okWh0y+oPjb/DfZABz2QRO7QT/aiL7bdetmeFmON6TPa6NFptZPiBr/8o6zzSfrlAtv+ j1GauuoaAXBttJQxikmAfhx5lSw/Uf0Dvt2hwUBsW/GBXuCIYFneU2ZfEyI8Dddw9FuRQ7YMJTOpy UHvQ0LTA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkjOc-00080M-Ih; Thu, 03 Dec 2020 07:51:22 +0000 Received: from mail-qv1-xf49.google.com ([2607:f8b0:4864:20::f49]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkjOZ-0007zA-IS for linux-arm-kernel@lists.infradead.org; Thu, 03 Dec 2020 07:51:20 +0000 Received: by mail-qv1-xf49.google.com with SMTP id ca17so988121qvb.1 for ; Wed, 02 Dec 2020 23:51:16 -0800 (PST) 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=B7DmYSIO+p1MkB/jlw8RbinJ3KbMQR4XaBTnYxKrSNI=; b=P6fVFXhow4LI42DxQGCbuF6aHKe0TNfjH/6xQdkEmkXJb+WSXPSx44sCAgIg+ZvkVB rsyo6YMrMAHVL8q6IR59Z7cDg1hW4MrhrV7jcO5yRroIKVzDnighGxX+LAGj4yV46Npi CKMrV1FMzA/jziCKM/5eghtNRjeCXzPMGuZMo2nhbSLU8R8En5vMJw8naHAQqJ13WCA3 SCgz2COmomqX/txs08HiJ3B7rdErWt1QNI9UeajnlF8Zy/t7YCyTprzCa71YC6xnJQd5 bu2DZxWatZHHGydrz614C6Zcn3mEaIqH7WSVm1vsLDAP9OzQ9dGt0l66wznYp+180Uit pTEg== 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=B7DmYSIO+p1MkB/jlw8RbinJ3KbMQR4XaBTnYxKrSNI=; b=KH6DHYRVCu8PqnRico042yYUx1spx50yEwH2C27WexBpBjylBREjQhJVdz4caAHBuV 4qW423AtweIdqs/l3LOOFgMmTs1ybARV4DtLDfZLHKWI9eTf8vgQZdiw/YmUeM45Pogg 1i8OdlgKMtELrRhH+yEkRDhlRij2YpC7CNNlNMJt1y0zfWcglus7us8WpN76gaqrVoHz FHjsSqI5o6E/6AO92bR2dCcOS4/5KKjYy1+X5ucr4tKpBSXgrwPkz3M5+obdwlu7HYx9 7jr/AazoEj3qFcy5kjDFNalVuQw/LhaylKa7lbqhOymLG0iMxFRystxw/E1Et/ybTtm2 ABog== X-Gm-Message-State: AOAM532ifmMJ2+r6rOfCS6hNGxHvHqqWYn19wLuW8mEgjOZImdIrruDU +cDzqt/d6cZgwhmT2KLYPkSuLJ4= X-Google-Smtp-Source: ABdhPJwFxbX6JklQEcIguN0Pp/2SEzj1Qqxlm5GV8dQ7e3tsTjOEBHtsnDmONRlNUcY4H8r59S3dYiM= X-Received: from pcc-desktop.svl.corp.google.com ([2620:15c:2ce:0:7220:84ff:fe09:385a]) (user=pcc job=sendgmr) by 2002:ad4:5544:: with SMTP id v4mr1810811qvy.43.1606981875396; Wed, 02 Dec 2020 23:51:15 -0800 (PST) Date: Wed, 2 Dec 2020 23:51:10 -0800 Message-Id: <20201203075110.2781021-1-pcc@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog Subject: [PATCH] arm64: mte: fix prctl(PR_GET_TAGGED_ADDR_CTRL) if TCF0=NONE From: Peter Collingbourne To: Catalin Marinas X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201203_025119_658038_CAA7FD82 X-CRM114-Status: GOOD ( 12.66 ) 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 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Previously we were always returning a tag inclusion mask of zero via PR_GET_TAGGED_ADDR_CTRL if TCF0 was set to NONE. Fix it by making the code for the NONE case match the others. Signed-off-by: Peter Collingbourne Link: https://linux-review.googlesource.com/id/Iefbea66cf7d2b4c80b82f9639b9ea7f33f7fac53 Reviewed-by: Catalin Marinas --- arch/arm64/kernel/mte.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/kernel/mte.c b/arch/arm64/kernel/mte.c index 52a0638ed967..ef15c8a2a49d 100644 --- a/arch/arm64/kernel/mte.c +++ b/arch/arm64/kernel/mte.c @@ -189,7 +189,8 @@ long get_mte_ctrl(struct task_struct *task) switch (task->thread.sctlr_tcf0) { case SCTLR_EL1_TCF0_NONE: - return PR_MTE_TCF_NONE; + ret |= PR_MTE_TCF_NONE; + break; case SCTLR_EL1_TCF0_SYNC: ret |= PR_MTE_TCF_SYNC; break;