# Re: \[PATCH v4 11/26\] arm64: mte: Add PROT\_MTE support to mmap() and mprotect()

- From: Peter Collingbourne \<hidden\>
- Date: 2020-05-27 18:57:53 
- List: linux-arm-kernel
- Page: https://ratatoskr.run/linux-arm-kernel/2020/05/6500485
- Thread: https://ratatoskr.run/linux-arm-kernel/2020/05/6500251/t.md

```text
On Fri, May 15, 2020 at 10:16 AM Catalin Marinas
[ref] wrote:
>
> To enable tagging on a memory range, the user must explicitly opt in via
> a new PROT_MTE flag passed to mmap() or mprotect(). Since this is a new
> memory type in the AttrIndx field of a pte, simplify the or'ing of these
> bits over the protection_map[] attributes by making MT_NORMAL index 0.

Should the userspace stack always be mapped as if with PROT_MTE if the
hardware supports it? Such a change would be invisible to non-MTE
aware userspace since it would already need to opt in to tag checking
via prctl. This would let userspace avoid a complex stack
initialization sequence when running with stack tagging enabled on the
main thread.

Peter

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