Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9398914pxu; Mon, 28 Dec 2020 15:12:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJxgQWCjjI4KxqOYE/w1VCHK9b1H0/Riu1xnKZjSeKIa2xBkIohnGIx+Yx+nJSXdCiGvgV0r X-Received: by 2002:a17:906:e18:: with SMTP id l24mr41977226eji.434.1609197155501; Mon, 28 Dec 2020 15:12:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609197155; cv=none; d=google.com; s=arc-20160816; b=q0gV2V8PPCcZgSNH1DeNMlTrNMGkp5smftOSPWY+N3+IS9jmWh9/kqd8EjqOLQEUj7 VK/2xrH79IuZVpjbPsyQocOY+Oe2X6Lmj9ESW3lMBnPhsQOc2mSzHJ0rXaYPjMHKQMZ6 M2W2RYyallfyD54NTFCI4Jzm8FIDbO8+PLdylVvNfSyuhDrpceB1ZRdgoS0Xz+WXwA8D q4XqHvvLFw38cWK9phGOEbjf81VJ/GzancNqxdmI5YfiKuZxBjruAaZV1iu4PSnKBZAt 6BRxRIn7DJhMPzXccVsxcHciBFtQ0HyrnVW++2UCxIYOaLnrPeax3VHBENFrF9dXvxzo i7yQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7QgWBjx+o45zvHGxDSees5+Mw0IC3yR+W8gC1+yEhgk=; b=CX8PzwYDBuHh4NqeGaaLeeKr86wE5NhdodK3auSmyxESdT2farKQOdTLyUhODzXgJj tyF5JN1l35clTjEvNjdGePlVE84mC+mpBFNBsWfkro6u3+Rv8jClRmLT7ImBZT16Tuin L3Er06/7ILNSvGkX6mgI2EAIkUnC/md+skQgU4UYsK8+5UHLkz5VTtveFbIqKk1hxqu7 y6RaqnYw7zMQw301bdpZRyy5uHUmlKKC5GB2sycUe0c88xqXzTboc8ZfBSrWp3ehhtLZ DtpWuoWV1PRw1pTJHPgQphqwCAqQBSpEJAm1l1UcsHUDqtEIw6alQ4f+O1PWX49Mau9v Wv/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iOpFPOrn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dq8si19767472ejc.750.2020.12.28.15.12.13; Mon, 28 Dec 2020 15:12:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iOpFPOrn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2440010AbgL1OMz (ORCPT + 99 others); Mon, 28 Dec 2020 09:12:55 -0500 Received: from mail.kernel.org ([198.145.29.99]:46706 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439910AbgL1OMz (ORCPT ); Mon, 28 Dec 2020 09:12:55 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id D160F206C3; Mon, 28 Dec 2020 14:12:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164759; bh=jNON4RhqYWiakI3JTWgBAK3/GWcahKidDO8HlqVMaaA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iOpFPOrn4sEYxFRPelA4iVeylmYoV6UOs6PI/gkXcyJiAnfuB2lG2xVCo0JoMyvkz 1qt2I3DSJD8NYLjW7ZvK8kAOhd8O+f4ONqlAqkyv48wuYEXFezG1I2WhsJDcRDaVW8 JYr0mA0pAqtlZqsQMKDmSW5P2clXCx9DnUjfF8xA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Collingbourne , Catalin Marinas , Will Deacon , Sasha Levin Subject: [PATCH 5.10 289/717] arm64: mte: fix prctl(PR_GET_TAGGED_ADDR_CTRL) if TCF0=NONE Date: Mon, 28 Dec 2020 13:44:47 +0100 Message-Id: <20201228125034.878626884@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Collingbourne [ Upstream commit 929c1f3384d7e5cd319d03242cb925c3f91236f7 ] 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 Fixes: af5ce95282dc ("arm64: mte: Allow user control of the generated random tags via prctl()") Reviewed-by: Catalin Marinas Link: https://lore.kernel.org/r/20201203075110.2781021-1-pcc@google.com Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- 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 52a0638ed967b..ef15c8a2a49dc 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; -- 2.27.0