https://gcc.gnu.org/bugzilla/show_bug.cgi?id=101744

Hongtao.liu <crazylht at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |crazylht at gmail dot com

--- Comment #3 from Hongtao.liu <crazylht at gmail dot com> ---
x86 also get 2 new failures
```
FAIL: c-c++-common/hwasan/alloca-gets-different-tag.c   -O2 -flto
-fuse-linker-plugin -fno-fat-lto-objects  execution test
FAIL: c-c++-common/hwasan/alloca-outside-caught.c   -O2 -flto
-fuse-linker-plugin -fno-fat-lto-objects  output pattern test
``` 

And failure is because pointer passes to __hwasan_tag_memory is supposed to be
untagged(it will call TagMemoryAligned and then call MemToShadow where it shift
the address w/ kShadowScale(here is 4).

inline uptr MemToShadow(uptr untagged_addr) {
  return (untagged_addr >> kShadowScale) + GetShadowOffset();
}

And for local arrays which need to be tagged, pointer passed to
__hwasan_tag_memory is rsp+offset where rsp is not tagged, and this should be
ok, but sometimes gcc will do optimization to convert rsp+offset to rbp+offset,
but rbp is tagged, then it will raise an exception of  SGEV SGEV for illegal
address.

Reply via email to