[llvm] [ASAN] Add "asan_instrumented" llvm ir attribute to identify AddressSanitizer instrumented globals (PR #68865)

via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 2 02:11:26 PDT 2023


skc7 wrote:

> GlobalVariable sanitization is done as a subset of `SanitizerMetadata` (what you've touched here is the sanitizer attributes for functions). You can take a look at [8db981d](https://github.com/llvm/llvm-project/commit/8db981d463ee266919907f2554194d05f96f7191) which should guide you to the right IR and bitcode printing/parsing logic.
> 
> Other than that, can you please make the "we increased the global variable size" names non-asan-specific? We also increase GV size on `-fsanitize=hwaddress` and `-fsanitize=memtag-globals` as well. Maybe an appropriate name is `sanitized_padded_global` (or something like that).

Thanks for the feedback @hctim. Renamed the attribute to "sanitized_padded_global".
 [8db981d](https://github.com/llvm/llvm-project/commit/8db981d463ee266919907f2554194d05f96f7191) has parsing/priniting logic to fill the SanitizerMetadata structure and also print the metadata of globals. I want to attach the new attribute to global variables and don't want to extend the SanitizerMetadata.

https://github.com/llvm/llvm-project/pull/68865


More information about the llvm-commits mailing list