| Issue |
186632
|
| Summary |
hwasan: hwasan-use-short-granules=1 does not generate short granules for local variables
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
shuffle2
|
This is somewhat a placeholder while I debug the issue. Filing a bug for now in case the issue is known already and/or there is a known workaround.
Compiling with these flags on riscv64:
```
-fsanitize=hwaddress
-mllvm -hwasan-instrument-with-calls=1
-mllvm -hwasan-use-short-granules=1
-mllvm -hwasan-all-globals=1
```
I notice that all stack variables get instrumented (via calls to `__hwasan_tag_memory`), however the size passed to `__hwasan_tag_memory` is always aligned up to 16bytes. Short granules are working properly for globals.
>From browsing the short granule implementation, it seems like it should apply to stack variables. This seems to imply the size of the variable is aligned up before that instrumentation code is reached. Notably, the real (unaligned) sizes of the stack variables are still used in calls to e.g. `memset` to zeroize them.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs