[llvm-dev] [MTE] Globals Tagging - Discussion

Szabolcs Nagy via llvm-dev llvm-dev at lists.llvm.org
Fri Nov 27 04:59:23 PST 2020


* Mitch Phillips <mitchp at google.com> [2020-11-10 12:00:20 -0800]:
> > > >   static int a[8];
> > > >   static int *p = a - 5;
> > > > ...
> > > >   p[10] = 1;
> > > > should work (even if it's not valid in c it can be valid as
> > > > a c extension or written in asm, so ELF should support it).
> > >
> > >
> > > IMO this is exactly the kind of thing that MTE is trying to *prevent*. I
> > > don't see why we would want to support something like this.
> > sorry for the late answer, but i disagree.
> 
> 
> No problem :). I also disagree with myself. In this example, the
> TAGGED_RELATIVE relocation for `p` contains an r_addend of `a`, meaning
> that the tag for `p` should be derived from `a`, not randomised. So if `a`
> has a memory tag of `0xf`, then `p` will also have a memory tag of `0xf`.
> Does this allay your fears?

ok that works.


More information about the llvm-dev mailing list