[clang] [llvm] [ASAN] For Asan instrumented global, emit two symbols, one with actual size and other with instrumented size. (PR #70166)

2024-02-15 Thread via cfe-commits
b-sumner wrote: Hi @hctim, I'm really not seeing how this patch could possibly prevent ASAN or other sanitizers from arbitrarily changing their implementations or placing arbitrary data in redzones. This patch is merely introducing additional symbols that overlap with the uninstrumented

[clang] [llvm] [ASAN] For Asan instrumented global, emit two symbols, one with actual size and other with instrumented size. (PR #70166)

2024-02-15 Thread Mitch Phillips via cfe-commits
hctim wrote: Messing around with global variables (changing their size, padding, alignment) is a common theme amongst sanitizers. We'd therefore want any strategy applied to ASan to be generic and apply across other sanitizers. The patch might not cause issues right now with ASan - but I

[clang] [llvm] [ASAN] For Asan instrumented global, emit two symbols, one with actual size and other with instrumented size. (PR #70166)

2024-02-14 Thread via cfe-commits
skc7 wrote: Hi @hctim, In this patch, we are identifying globals that are instrumented using an new IR attribute and for them extra symbol with padded size is emitted. This is done only in ASAN pass. Not sure how would that affect HWAsan and MTE-globals. Could you please give an example for

[clang] [llvm] [ASAN] For Asan instrumented global, emit two symbols, one with actual size and other with instrumented size. (PR #70166)

2024-02-09 Thread Mitch Phillips via cfe-commits
hctim wrote: Hi, My apologies for the delay. I started to hack together the same idea using `SanitizerMetadata`, which is definitely the preferred way of adding sanitizer globalvariable instrumentation (given that everything else already lives there). You can see the WIP here:

[clang] [llvm] [ASAN] For Asan instrumented global, emit two symbols, one with actual size and other with instrumented size. (PR #70166)

2024-02-02 Thread via cfe-commits
skc7 wrote: @hctim @MaskRay @vitalybuka #70166 and #68865 have been pending for review and approvals for few months now. All the feedback has been useful in improving the patch. Made the changes to patches as per feedback. Please review. https://github.com/llvm/llvm-project/pull/70166

[clang] [llvm] [ASAN] For Asan instrumented global, emit two symbols, one with actual size and other with instrumented size. (PR #70166)

2024-01-19 Thread via cfe-commits
skc7 wrote: #68865 and #70166 have been rebased and updated as per review comments. Please review. https://github.com/llvm/llvm-project/pull/70166 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [llvm] [ASAN] For Asan instrumented global, emit two symbols, one with actual size and other with instrumented size. (PR #70166)

2024-01-19 Thread via cfe-commits
https://github.com/skc7 updated https://github.com/llvm/llvm-project/pull/70166 >From 45d7b14e494ce771460ba263c5573f0fb4715246 Mon Sep 17 00:00:00 2001 From: skc7 Date: Wed, 25 Oct 2023 10:46:10 +0530 Subject: [PATCH] [ASAN] For Asan instrumented globals, emit two symbols, with actual size and

[clang] [llvm] [ASAN] For Asan instrumented global, emit two symbols, one with actual size and other with instrumented size. (PR #70166)

2023-11-01 Thread Mitch Phillips via cfe-commits
hctim wrote: Will wait for a rebase on some changes requested in #68865, but it'd also be really important to write tests for a couple more scenarios: 1. Building with `-fsanitize=address -S -emit-llvm` results in GVs with `sanitized_padded_global` (and results in GVs without

[clang] [llvm] [ASAN] For Asan instrumented global, emit two symbols, one with actual size and other with instrumented size. (PR #70166)

2023-11-01 Thread Mitch Phillips via cfe-commits
hctim wrote: > > It's my understanding your problem is that you are asan-trapping on the > > redzones when you copy data to/from the device. Is it possible instead to > > just make those copy-from and copy-to functions in the runtime > > `__attribute__((no_sanitize("address")))` and copy the