linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] arm64: mte: fix prctl(PR_GET_TAGGED_ADDR_CTRL) if TCF0=NONE
@ 2020-12-03  7:51 Peter Collingbourne
  2020-12-03 14:51 ` Catalin Marinas
  2020-12-03 18:38 ` Will Deacon
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Collingbourne @ 2020-12-03  7:51 UTC (permalink / raw)
  To: Catalin Marinas; +Cc: Peter Collingbourne, Linux ARM

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 <pcc@google.com>
Link: https://linux-review.googlesource.com/id/Iefbea66cf7d2b4c80b82f9639b9ea7f33f7fac53
---
 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;
-- 
2.29.2.454.gaff20da3a2-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: mte: fix prctl(PR_GET_TAGGED_ADDR_CTRL) if TCF0=NONE
  2020-12-03  7:51 [PATCH] arm64: mte: fix prctl(PR_GET_TAGGED_ADDR_CTRL) if TCF0=NONE Peter Collingbourne
@ 2020-12-03 14:51 ` Catalin Marinas
  2020-12-03 18:38 ` Will Deacon
  1 sibling, 0 replies; 3+ messages in thread
From: Catalin Marinas @ 2020-12-03 14:51 UTC (permalink / raw)
  To: Peter Collingbourne; +Cc: Will Deacon, Linux ARM

On Wed, Dec 02, 2020 at 11:51:10PM -0800, Peter Collingbourne wrote:
> 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 <pcc@google.com>
> Link: https://linux-review.googlesource.com/id/Iefbea66cf7d2b4c80b82f9639b9ea7f33f7fac53
> ---
>  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;

With a fixes tag:

Fixes: af5ce95282dc ("arm64: mte: Allow user control of the generated random tags via prctl()")
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>

Will, if you have another pull request for 5.10, please pick this up as
well (it's an ABI fix so it would be nice to get it in the first release
with MTE support). Otherwise I'll queue it at -rc1 and cc stable.

Thanks.

-- 
Catalin

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: mte: fix prctl(PR_GET_TAGGED_ADDR_CTRL) if TCF0=NONE
  2020-12-03  7:51 [PATCH] arm64: mte: fix prctl(PR_GET_TAGGED_ADDR_CTRL) if TCF0=NONE Peter Collingbourne
  2020-12-03 14:51 ` Catalin Marinas
@ 2020-12-03 18:38 ` Will Deacon
  1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2020-12-03 18:38 UTC (permalink / raw)
  To: Peter Collingbourne, Catalin Marinas; +Cc: Will Deacon, kernel-team, Linux ARM

On Wed, 2 Dec 2020 23:51:10 -0800, Peter Collingbourne wrote:
> 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.

Applied to arm64 (for-next/fixes), thanks!

[1/1] arm64: mte: fix prctl(PR_GET_TAGGED_ADDR_CTRL) if TCF0=NONE
      https://git.kernel.org/arm64/c/929c1f3384d7

Cheers,
-- 
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-12-03 18:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-03  7:51 [PATCH] arm64: mte: fix prctl(PR_GET_TAGGED_ADDR_CTRL) if TCF0=NONE Peter Collingbourne
2020-12-03 14:51 ` Catalin Marinas
2020-12-03 18:38 ` Will Deacon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).