[PATCH] D102901: [HWASan] Add basic stack tagging support for LAM.

2021-06-09 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka accepted this revision. vitalybuka added inline comments. This revision is now accepted and ready to land. Comment at: llvm/lib/Transforms/Instrumentation/HWAddressSanitizer.cpp:503 + // planned for globals as well. + bool IsX86 = TargetTriple.getArch() == Triple::x8

[PATCH] D104076: [clang-cl][sanitizer] Add -fsanitize-address-use-after-return to clang.

2021-06-10 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka accepted this revision. vitalybuka added a comment. This revision is now accepted and ready to land. LGTM with some nits and if you extract FunctionStackPoisoner::initializeCallbacks into a separate patch Comment at: clang/test/CodeGen/asan-use-after-return.cpp:3 +/

[PATCH] D104155: Add documentation for -fsanitize-address-use-after-return.

2021-06-11 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: clang/docs/AddressSanitizer.rst:18 +* Use-after-return (clang flag `-fsanitize-address-use-after-return=(always|runtime|never)` default: runtime) + * Add runtime flag `ASAN_OPTIONS=detect_stack_use_after_return=1` to enable when co

[PATCH] D101868: [clang-format] Adds a formatter for aligning arrays of structs

2021-06-14 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: clang/test/Format/struct-array-initializer.cpp:5 +// RUN: grep -Ev "// *[A-Z-]+:" %s \ +// RUN: | clang-format -style="{BasedOnStyle: LLVM, AlignArrayOfStructures: Left}" %s \ +// RUN: | FileCheck -strict-whitespace -check-prefix

[PATCH] D104279: [asan] Remove Asan, Ubsan support of RTEMS and Myriad

2021-06-14 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka created this revision. Herald added subscribers: phosek, jfb, fedor.sergeev, hiraditya, krytarowski, mgorny. vitalybuka requested review of this revision. Herald added projects: clang, Sanitizers, LLVM. Herald added subscribers: llvm-commits, Sanitizers, cfe-commits. Repository: rG L

[PATCH] D104275: [compiler-rt][hwasan] Add SHADOW_OFFSET macro

2021-06-14 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: compiler-rt/lib/hwasan/hwasan_mapping.h:57 extern uptr kAliasRegionStart; Maybe the following to minimize code which compiles only on limited set of platforms? ``` inline uptr GetShadowOffset() { return SANIT

[PATCH] D104279: [asan] Remove Asan, Ubsan support of RTEMS and Myriad

2021-06-15 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka updated this revision to Diff 352215. vitalybuka added a comment. Herald added a subscriber: dexonsmith. restore few lines Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104279/new/ https://reviews.llvm.org/D104279 Files: clang/lib/Dri

[PATCH] D104279: [asan] Remove Asan, Ubsan support of RTEMS and Myriad

2021-06-15 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka updated this revision to Diff 352221. vitalybuka added a comment. remove unrelated fix Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104279/new/ https://reviews.llvm.org/D104279 Files: clang/lib/Driver/ToolChains/CommonArgs.cpp comp

[PATCH] D104279: [asan] Remove Asan, Ubsan support of RTEMS and Myriad

2021-06-15 Thread Vitaly Buka via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG6478ef61b1a4: [asan] Remove Asan, Ubsan support of RTEMS and Myriad (authored by vitalybuka). Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D104155: Add documentation for -fsanitize-address-use-after-return.

2021-06-15 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a subscriber: rsmith. vitalybuka added inline comments. Comment at: clang/docs/ClangCommandLineReference.rst:3 --- NOTE: This file is automatically generated by running clang-tblgen -gen-opt

[PATCH] D104248: [compiler-rt][hwasan] Refactor Thread::Init

2021-06-15 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: compiler-rt/lib/hwasan/hwasan_linux.cpp:430 +void Thread::Init(uptr stack_buffer_start, uptr stack_buffer_size) { + CHECK_EQ(0, unique_id_); // try to catch bad stack reuse leonardchan wrote: > leonardchan wrote:

[PATCH] D104155: Add documentation for -fsanitize-address-use-after-return.

2021-06-15 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: clang/docs/AddressSanitizer.rst:19 +* Enable ``runtime`` with: ``ASAN_OPTIONS=detect_stack_use_after_return=1`` +* Use-after-scope (clang flag ``-fsanitize-address-use-after-scope``) * Double-free, invalid free s

[PATCH] D104275: [compiler-rt][hwasan] Add GetShadowOffset function

2021-06-15 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: compiler-rt/lib/hwasan/hwasan_mapping.h:54 +inline uptr GetShadowOffset() { + return SANITIZER_FUCHSIA ? 0 : __hwasan_shadow_memory_dynamic_address; +} mcgrathr wrote: > I think you'll eventually need to make this an

[PATCH] D101832: [clang] accept -fsanitize-ignorelist= in addition to -fsanitize-blacklist=

2021-06-15 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D101832#2820465 , @MaskRay wrote: > In D101832#2736636 , @MaskRay wrote: > >> I think @vitalybuka has concrete suggestion on the naming. > > If ignorelist is used, I can delete `-fsa

[PATCH] D104275: [compiler-rt][hwasan] Add GetShadowOffset function

2021-06-16 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: compiler-rt/lib/hwasan/hwasan_mapping.h:54 +inline uptr GetShadowOffset() { + return SANITIZER_FUCHSIA ? 0 : __hwasan_shadow_memory_dynamic_address; +} mcgrathr wrote: > vitalybuka wrote: > > mcgrathr wrote: > > > I

[PATCH] D104248: [compiler-rt][hwasan] Refactor Thread::Init

2021-06-16 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka accepted this revision. vitalybuka added a reviewer: mcgrathr. vitalybuka added inline comments. Comment at: compiler-rt/lib/hwasan/hwasan_linux.cpp:430 +void Thread::Init(uptr stack_buffer_start, uptr stack_buffer_size) { + CHECK_EQ(0, unique_id_); // try to catch

[PATCH] D104494: [dfsan] Replace dfs$ prefix with .dfsan suffix

2021-06-18 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. https://lab.llvm.org/buildbot/#/builders/37/builds/4620 looks broken by this patch Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104494/new/ https://reviews.llvm.org/D104494

[PATCH] D104155: Add documentation for -fsanitize-address-use-after-return.

2021-06-18 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka accepted this revision. vitalybuka added inline comments. This revision is now accepted and ready to land. Comment at: clang/docs/AddressSanitizer.rst:17-19 +* Use-after-return (clang flag ``-fsanitize-address-use-after-return=(never|runtime|always)`` default: ``runt

[PATCH] D104155: Add documentation for -fsanitize-address-use-after-return.

2021-06-18 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: clang/docs/AddressSanitizer.rst:143 + +AddressSanitizer (``-fsanitize=address``) can optionally detect stack use after +return problems. Maybe -fsanitize=address is reduntant here, we are already in the -fsanitize=ad

[PATCH] D107633: Set supported target for asan-use-callbacks test

2021-08-09 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. Why other tests, like CodeGen/asan-strings.c do not need REQUIRES: ? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107633/new/ https://reviews.llvm.org/D107633 ___ cfe-commits

[PATCH] D107633: Set supported target for asan-use-callbacks test

2021-08-09 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka accepted this revision. vitalybuka added a comment. This revision is now accepted and ready to land. All but line 1 is LGTM Line 1 is probably not needed, but I don't know why. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107633/new/ ht

[PATCH] D108083: add sanitizer support to hexagon

2021-08-16 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. Can you cut this into separate peaces, at least patch per sanitizer for "asan lsan ubsan scudo scudo_standalone cfi safestack"? Some common peaces could be probably extracted as well. Comment at: compiler-rt/lib/sanitizer_common/sanitizer_platform_

[PATCH] D108083: add sanitizer support to hexagon

2021-08-16 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. Do we have public bot for hexagon? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108083/new/ https://reviews.llvm.org/D108083 ___ cfe-commits mailing list cfe-commits@lists.ll

[PATCH] D108083: [PATCH 1/8] [sanitizer] Add hexagon support to sanitizer-common

2021-08-17 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka accepted this revision. vitalybuka added a comment. This revision is now accepted and ready to land. Please correct me if I am wrong, but LLVM does not use [PATCH *] tags for series. Please remove them from title and git patches. You can link dependent patches into Phabricator "stack"

[PATCH] D108083: [PATCH 1/8] [sanitizer] Add hexagon support to sanitizer-common

2021-08-17 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka requested changes to this revision. vitalybuka added a comment. This revision now requires changes to proceed. Sorry, approved accidentally. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108083/new/ https://reviews.llvm.org/D108083

[PATCH] D108083: [PATCH 1/8] [sanitizer] Add hexagon support to sanitizer-common

2021-08-17 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D108083#2948056 , @bcain wrote: > In D108083#2947914 , @vitalybuka > wrote: > >> Do we have public bot for hexagon? > > I think we have one intended to for checking hexagon-unknown-

[PATCH] D107850: [asan] Implemented custom calling convention similar to the one used by HWASan for X86.

2021-08-17 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. This can be split into 3 patches in the following order: 1. x86 2. Instrumentation 3. clang Each of them needs tests, Intrtumentation changes are not tested. Comment at: llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h:150 +namespa

[PATCH] D108083: [sanitizer] Add hexagon support to sanitizer-common

2021-08-17 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D108083#2949934 , @bcain wrote: > In D108083#2949815 , @vitalybuka > wrote: > >>> We can help create a bot for hexagon-unknown-linux-musl. What's the process? >> >> Thank you. https

[PATCH] D108083: [sanitizer] Add hexagon support to sanitizer-common

2021-08-17 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. The last snapshot uploaded without "arc diff", so it does not show "context" code around, which is inconvenient for review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108083/new/ https://reviews.llvm.org/D108083 ___

[PATCH] D108083: [sanitizer] Add hexagon support to sanitizer-common

2021-08-17 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cpp:94 # include #if defined(__mips64) || defined(__aarch64__) || defined(__arm__) || \ +defined(__hexagon__) || \ please use clang-format versi

[PATCH] D107850: [asan] [Patch 1/3] Implemented custom calling convention similar to the one used by HWASan for X86.

2021-08-17 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. Can you please use "Edit related revisions" and link other patches of the features into the stack? Comment at: llvm/lib/Target/X86/X86InstrCompiler.td:272-274 + [(int_asan_check_memaccess GR64NoR8:$addr, (i64 timm:$shadowbase), +(i32 timm:$iswr

[PATCH] D107850: [asan] [Patch 1/3] Implemented custom calling convention similar to the one used by HWASan for X86.

2021-08-17 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: llvm/lib/Target/X86/X86MCInstLower.cpp:1369 + .addReg(X86::R8) + .addImm(MappingScale), + STI); vitalybuka wrote: > I a

[PATCH] D108083: [sanitizer] Add hexagon support to sanitizer-common

2021-08-17 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka accepted this revision. vitalybuka added a comment. This revision is now accepted and ready to land. LGTM, but maybe wait for @sidneym feedback, or add as "blocking reviewer". Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108083/new/ htt

[PATCH] D107850: [asan] [Patch 1/3] Implemented custom calling convention similar to the one used by HWASan for X86.

2021-08-17 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. Please don't do [PATCH*] tags and just organize Phabricator "stack" Just in case, it should look like this random image from search: https://firefox-source-docs.mozilla.org/_images/example-stack.png Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D108323: [asan] Added -inline-small-callbacks LLVM flag, which would force inline code for 8 and 16 byte data types when otherwise a callback would have been used.

2021-08-19 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: clang/test/CodeGen/asan-use-callbacks.cpp:15 -int deref(int *p) { +long deref(long *p) { return *p; kcc wrote: > As we introduce a difference in behavior for small and large accesses, > I would extend this test

[PATCH] D107850: [asan] Implemented custom calling convention similar to the one used by HWASan for X86.

2021-08-19 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D107850#2952641 , @kstoimenov wrote: > I know it seems redundant to pass the constants with every function call, but > otherwise the code generation code will have to take dependency on > AddressSanitizerCommon.h, which I

[PATCH] D108377: [asan] Implemented custom calling convention similar used by HWASan for X86.

2021-08-19 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h:151 +// Get AddressSanitizer parameters. +void getAddressSanitizerParams(Module &M, uint64_t *ShadowBase, + int *MappingScale, bool *OrShado

[PATCH] D107850: [asan] Implemented custom calling convention similar to the one used by HWASan for X86.

2021-08-19 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: llvm/include/llvm/IR/Intrinsics.td:1640 +def int_asan_check_memaccess : + Intrinsic<[],[llvm_ptr_ty, llvm_i8_ty, llvm_i8_ty], PTAL at lvm.read_register.i32 How about: llvm.asan.check.memaccess -> lvm.asan.check

[PATCH] D107850: [asan] Implemented custom calling convention similar to the one used by HWASan for X86.

2021-08-19 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: llvm/include/llvm/IR/Intrinsics.td:1640 +def int_asan_check_memaccess : + Intrinsic<[],[llvm_ptr_ty, llvm_i8_ty, llvm_i8_ty], vitalybuka wrote: > PTAL at lvm.read_register.i32 > > How about: > > llvm.asan.check.m

[PATCH] D108377: [asan] Implemented custom calling convention similar used by HWASan for X86.

2021-08-19 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:571 + getShadowMapping(TargetTriple, M.getDataLayout().getPointerSizeInBits(), + ClEnableKasan.getNumOccurrences() > 0); + *ShadowBase = Mapping.Offs

[PATCH] D105265: [X86] AVX512FP16 instructions enabling 3/6

2021-08-19 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. I suspect this error from this or D105331 https://lab.llvm.org/buildbot/#/builders/85/builds/6132 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105265/new/ https://reviews.llvm.org/D105

[PATCH] D105265: [X86] AVX512FP16 instructions enabling 3/6

2021-08-19 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a subscriber: kstoimenov. vitalybuka added a comment. FYI @kstoimenov Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105265/new/ https://reviews.llvm.org/D105265 ___ cfe-commits mailing l

[PATCH] D107850: [asan] Implemented custom calling convention similar to the one used by HWASan for X86.

2021-08-19 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a subscriber: eugenis. vitalybuka added inline comments. Comment at: llvm/include/llvm/IR/Intrinsics.td:1640 +def int_asan_check_memaccess : + Intrinsic<[],[llvm_ptr_ty, llvm_i8_ty, llvm_i8_ty], kstoimenov wrote: > vitalybuka wrote: > > vitaly

[PATCH] D107850: [asan] Implemented intrinsic for the custom calling convention similar used by HWASan for X86.

2021-08-19 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: llvm/include/llvm/IR/Intrinsics.td:1640 +def int_asan_check_memaccess : + Intrinsic<[],[llvm_ptr_ty, llvm_i8_ty, llvm_i8_ty], pcc wrote: > eugenis wrote: > > vitalybuka wrote: > > > kstoimenov wrote: > > > > vitaly

[PATCH] D108377: [asan] Implemented flag to emit intrinsics to optimize ASan callbacks.

2021-08-19 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: clang/test/CodeGen/asan-use-callbacks.cpp:9 +// RUN: -fsanitize=address %s -fsanitize-address-outline-instrumentation \ +// RUN: -mllvm -asan-optimize-callbacks \ +// RUN: | FileCheck %s --check-prefixes=CHECK-OPTIMIZED --

[PATCH] D108377: [asan] Implemented flag to emit intrinsics to optimize ASan callbacks.

2021-08-19 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: clang/test/CodeGen/asan-use-callbacks.cpp:9 +// RUN: -fsanitize=address %s -fsanitize-address-outline-instrumentation \ +// RUN: -mllvm -asan-optimize-callbacks \ +// RUN: | FileCheck %s --check-prefixes=CHECK-OPTIMIZED --

[PATCH] D107850: [asan] Implemented intrinsic for the custom calling convention similar used by HWASan for X86.

2021-08-19 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: llvm/include/llvm/IR/Intrinsics.td:1640 +def int_asan_check_memaccess : + Intrinsic<[],[llvm_ptr_ty, llvm_i8_ty, llvm_i8_ty], eugenis wrote: > vitalybuka wrote: > > pcc wrote: > > > eugenis wrote: > > > > vitalybuk

[PATCH] D107850: [asan] Implemented intrinsic for the custom calling convention similar used by HWASan for X86.

2021-08-19 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: llvm/test/CodeGen/X86/asan-check-memaccess-or.ll:47 + %2 = bitcast i64* %x to i8* + call void @llvm.asan.check.memaccess(i8* %2, i64 2147450880, i32 0, + i32 3, i32 3, i32 1) Is

[PATCH] D105726: Added fsanitize-address-instrument-via-callback, which controls if address sanitizer will always use a callback.

2021-07-09 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a subscriber: kcc. vitalybuka added a comment. Why do we need this? I thought the plan to have instrumentation with better callbacks which will be small and close to efficiency to inlined instrumentation. In this case we will make it default and can avoid another frontend switc

[PATCH] D105726: Added fsanitize-address-instrument-via-callback, which controls if address sanitizer will always use a callback.

2021-07-13 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka requested changes to this revision. vitalybuka added a comment. This revision now requires changes to proceed. I took another looks and noticed: also clang/docs/UsersManual.rst and maybe clang/docs/AddressSanitizer.rst also could you add some trivial test that the flag affects generated

[PATCH] D105726: Added fsanitize-address-instrument-via-callback, which controls if address sanitizer will always use a callback.

2021-07-13 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D105726#2875482 , @kstoimenov wrote: > Modified UsersManual.rst and added a test. Couldn't find a relevant section in > AddressSanitizer.rst and adding a new one is outside of the scope of this > change. something like: L

[PATCH] D105703: [hwasan] Use stack safety analysis.

2021-07-14 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: clang/test/CodeGen/hwasan-stack-safety-analysis-asm.c:4 + +int main(int argc, char **argv) { + char buf[10]; this patch mostly change code under llvm/ so tests should be also there, as IR tests

[PATCH] D105703: [hwasan] Use stack safety analysis.

2021-07-14 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. Other than missing llvm test is LGTM Comment at: clang/test/CodeGen/hwasan-stack-safety-analysis-asm.c:4 + +int main(int argc, char **argv) { + char buf[10]; fmayer wrote: > vitalybuka wrote: > > this patch mostly change code under

[PATCH] D105726: Added fsanitize-address-instrument-via-callback, which controls if address sanitizer will always use a callback.

2021-07-14 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka accepted this revision. vitalybuka added a comment. This revision is now accepted and ready to land. Thanks, LGTM. Do you have commit access? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105726/new/ https://reviews.llvm.org/D105726 ___

[PATCH] D105726: [asan][clang] Add flag to outline instrumentation

2021-07-14 Thread Vitaly Buka via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGac500fd18f06: [asan][clang] Add flag to outline instrumentation (authored by kstoimenov, committed by vitalybuka). Changed prior to commit: https:

[PATCH] D112098: [ASan] Added stack safety support in address sanitizer.

2021-10-26 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka accepted this revision. vitalybuka added a comment. This revision is now accepted and ready to land. Can you please fix in a separate patch llvm::runPassPipeline: it runs ModulePass after the function pass for -passes=asan-pipeline Comment at: llvm/lib/Transforms/In

[PATCH] D112098: [ASan] Added stack safety support in address sanitizer.

2021-10-26 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka requested changes to this revision. vitalybuka added inline comments. This revision now requires changes to proceed. Comment at: llvm/include/llvm/Analysis/StackSafetyAnalysis.h:93 + bool invalidate(Module &, const PreservedAnalyses &, + ModuleAnalysi

[PATCH] D112098: [ASan] Added stack safety support in address sanitizer.

2021-10-26 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added subscribers: morehouse, pcc, eugenis. vitalybuka added inline comments. Comment at: llvm/include/llvm/Analysis/StackSafetyAnalysis.h:93 + bool invalidate(Module &, const PreservedAnalyses &, + ModuleAnalysisManager::Invalidator &) { +return

[PATCH] D112732: [ASan] Removed AddressSanitizerPass function pass class and rolled it into the module pass for the new pass mangager only.

2021-10-28 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D112732#3094158 , @kstoimenov wrote: > Tests are not passing. Hold off the review. Yep, removed FUNCTION_PASS_WITH_PARAMS("asan", must affect some tests Comment at: llvm/include/llvm/Transforms/Instrum

[PATCH] D112732: [ASan] Removed AddressSanitizerPass function pass class and rolled it into the module pass for the new pass mangager only.

2021-11-01 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: llvm/include/llvm/Transforms/Instrumentation/AddressSanitizer.h:92 -struct AddressSanitizerOptions { - AddressSanitizerOptions() Why do we need to remove AddressSanitizerOptions? Comment at: llvm

[PATCH] D113072: [NFC][asan] Use AddressSanitizerOptions in ModuleAddressSanitizerPass

2021-11-02 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka created this revision. Herald added subscribers: ormris, hiraditya. vitalybuka requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D113072 Files: cl

[PATCH] D113072: [NFC][asan] Use AddressSanitizerOptions in ModuleAddressSanitizerPass

2021-11-02 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka updated this revision to Diff 384292. vitalybuka added a comment. unused var Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113072/new/ https://reviews.llvm.org/D113072 Files: clang/lib/CodeGen/BackendUtil.cpp llvm/include/llvm/Trans

[PATCH] D113072: [NFC][asan] Use AddressSanitizerOptions in ModuleAddressSanitizerPass

2021-11-02 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka updated this revision to Diff 384302. vitalybuka added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D113072/new/ https://reviews.llvm.org/D113072 Files: clang/lib/CodeGen/BackendUtil.cpp llvm/include/llvm/Transform

[PATCH] D112732: [ASan] Process functions in Asan module pass

2021-11-02 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka updated this revision to Diff 384303. vitalybuka added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112732/new/ https://reviews.llvm.org/D112732 Files: clang/lib/CodeGen/BackendUtil.cpp llvm/lib/Passes/PassBuilder

[PATCH] D112732: [ASan] Process functions in Asan module pass

2021-11-02 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka accepted this revision. vitalybuka added a comment. This revision is now accepted and ready to land. Lets keep AddressSanitizerPass for a while, we don't have to remove it in the same patch Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:1289 +

[PATCH] D113072: [NFC][asan] Use AddressSanitizerOptions in ModuleAddressSanitizerPass

2021-11-03 Thread Vitaly Buka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG3131714f8dac: [NFC][asan] Use AddressSanitizerOptions in ModuleAddressSanitizerPass (authored by vitalybuka). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1

[PATCH] D112732: [ASan] Process functions in Asan module pass

2021-11-03 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka updated this revision to Diff 384539. vitalybuka added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112732/new/ https://reviews.llvm.org/D112732 Files: clang/lib/CodeGen/BackendUtil.cpp llvm/lib/Passes/PassBuilder

[PATCH] D112098: [ASan] Added stack safety support in address sanitizer.

2021-11-03 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka accepted this revision. vitalybuka added inline comments. This revision is now accepted and ready to land. Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:1511 + if (ClUseStackSafety && SSGI != nullptr && findAllocaForValue(Ptr) && + SSGI->

[PATCH] D112732: [ASan] Process functions in Asan module pass

2021-11-04 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:1289 + } + Modified |= ModuleSanitizer.instrumentModule(M); + if (Modified) vitalybuka wrote: > kstoimenov wrote: > > At first I had module sanitizer run fir

[PATCH] D112732: [ASan] Process functions in Asan module pass

2021-11-04 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D112732#3107387 , @aeubanks wrote: > can we rename "asan-module" to "asan" after this change? and remove the extra > "asan-pipeline"/"asan-function-pipeline" parsing callbacks in > NewPMDriver.cpp? and previously we had `-

[PATCH] D112098: [ASan] Added stack safety support in address sanitizer.

2021-11-04 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka accepted this revision. vitalybuka added inline comments. This revision is now accepted and ready to land. Comment at: llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp:1328 + ClUseStackSafety ? &MAM.getResult(M) : nullptr; + AddressSanitizer FunctionSani

[PATCH] D113529: [asan] Minimal fix for PR52382

2021-11-09 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka created this revision. Herald added a subscriber: ormris. vitalybuka requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Alternative to a55c4ec1cee7683d9095327d9d33e7137ec25292

[PATCH] D96120: [scudo] Port scudo sanitizer to Windows

2021-02-26 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. >> This is intended as a step to porting scudo standalone. Why this is needed for scudo stadalone? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96120/new/ https://reviews.llvm.org/D96120 __

[PATCH] D96120: [scudo] Port scudo sanitizer to Windows

2021-03-02 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: clang/lib/Driver/ToolChains/MSVC.cpp:489 + if (TC.getSanitizerArgs().needsScudoRt()) { +for (const auto &Lib : {"scudo", "scudo_cxx"}) { We need this for both legacy and standalone scudo? C

[PATCH] D114421: [asan] Add support for disable_sanitizer_instrumentation attribute

2021-12-02 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka accepted this revision. vitalybuka added a comment. Should we have in AddressSanitizer.cpp the following for consistency with other sanitizers? if (F.hasFnAttribute(Attribute::DisableSanitizerInstrumentation)) return false; Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D136601: [OpenMP] [OMPIRBuilder] Create a new datatype to hold the unique target region info

2022-10-27 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:3031 +OrderedEntries[E.getOrder()] = +std::make_tuple(&E, Loc, EntryInfo.ParentName); +ParentFunctions[E.getOrder()] = EntryInfo.ParentName; mikerice w

[PATCH] D131806: Update hwasan test to fix failure on older Android API versions.

2022-08-12 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: clang/test/CodeGen/sanitizer-special-case-list-globals.c:5 // RUN: %clang_cc1 -emit-llvm %s -o -\ // RUN: -fsanitize-ignorelist=%S/Inputs/sanitizer-special-case-list-globals.txt \ // RUN: | FileCheck %s --check-prefix=NONE ---

[PATCH] D131806: Update hwasan test to fix failure on older Android API versions.

2022-08-12 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka accepted this revision. vitalybuka added a comment. This revision is now accepted and ready to land. Either way is good, but I slightly prefer the triple. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131806/new/ https://reviews.llvm.org

[PATCH] D132275: [clang] Reset some attributed calling lambda

2022-08-19 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka created this revision. Herald added a project: All. vitalybuka requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Lambda invoker sets this argument to Undef, making it inconsistent with noundef, notnull, and dereferencable attribute

[PATCH] D132275: [clang] Reset some attributed calling lambda

2022-08-20 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka updated this revision to Diff 454175. vitalybuka added a comment. fix for result slot Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132275/new/ https://reviews.llvm.org/D132275 Files: clang/lib/CodeGen/CGClass.cpp clang/lib/CodeGen/

[PATCH] D132275: [clang] Reset some attributed calling lambda

2022-08-20 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka updated this revision to Diff 454176. vitalybuka added a comment. remove dump Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132275/new/ https://reviews.llvm.org/D132275 Files: clang/lib/CodeGen/CGClass.cpp clang/lib/CodeGen/CodeGenF

[PATCH] D132324: [RFC] Remove support for building libc++ with `LLVM_ENABLE_PROJECTS`

2022-08-21 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D132324#3738253 , @MaskRay wrote: > @vitalybuka `-DLLVM_ENABLE_PROJECTS='libcxx;libcxxabi'` in > `zorg/buildbot/builders/sanitizers/buildbot_functions.sh` needs adjustment. If I do -DLLVM_ENABLE_RUNTIMES='libcxx;libcxxabi

[PATCH] D132324: [RFC] Remove support for building libc++ with `LLVM_ENABLE_PROJECTS`

2022-08-21 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D132324#3738430 , @vitalybuka wrote: > In D132324#3738253 , @MaskRay wrote: > >> @vitalybuka `-DLLVM_ENABLE_PROJECTS='libcxx;libcxxabi'` in >> `zorg/buildbot/builders/sanitizers/bu

[PATCH] D132275: [clang] Reset some attributed calling lambda

2022-08-22 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D132275#3740479 , @efriedma wrote: > Among other things, we could use a definition from a different module. Is this a thing, I assumed lambda is always defined in the module? > Either we relax the requirements globally for

[PATCH] D132275: [clang] Reset some attributed calling lambda

2022-08-22 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D132275#3740822 , @efriedma wrote: > In D132275#3740802 , @vitalybuka > wrote: > >> In D132275#3740479 , @efriedma >> wrote: >> >>> Among

[PATCH] D132275: [clang] Create alloca to pass into static lambda

2022-08-22 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka updated this revision to Diff 454628. vitalybuka added a comment. created alloca instead of changing attributes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132275/new/ https://reviews.llvm.org/D132275 Files: clang/lib/CodeGen/CGClas

[PATCH] D132275: [clang] Create alloca to pass into static lambda

2022-08-22 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka updated this revision to Diff 454629. vitalybuka added a comment. new line Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132275/new/ https://reviews.llvm.org/D132275 Files: clang/lib/CodeGen/CGClass.cpp clang/test/CodeGenCXX/lambda-

[PATCH] D132275: [clang] Create alloca to pass into static lambda

2022-08-23 Thread Vitaly Buka via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb5a9adf1f533: [clang] Create alloca to pass into static lambda (authored by vitalybuka). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132275/new/ https://r

[PATCH] D131714: [compiler-rt][builtins] Add compiler flags to catch potential errors that can lead to security vulnerabilities

2022-08-25 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. This patches breaks windows bot https://lab.llvm.org/buildbot/#/builders/127/builds/34791 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131714/new/ https://reviews.llvm.org/D131714 _

[PATCH] D131714: [compiler-rt][builtins] Add compiler flags to catch potential errors that can lead to security vulnerabilities

2022-08-25 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D131714#3750091 , @ahatanak wrote: > It's still failing. It looks like I have to add checks for other flags too. Thank you! Windows bot is fixed https://lab.llvm.org/buildbot/#/builders/127/builds/34851 Repository: rG

[PATCH] D133157: Add -fsanitizer-coverage=control-flow

2022-09-15 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka updated this revision to Diff 460525. vitalybuka added a comment. clang test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133157/new/ https://reviews.llvm.org/D133157 Files: clang/docs/SanitizerCoverage.rst clang/include/clang/Basi

[PATCH] D133157: Add -fsanitizer-coverage=control-flow

2022-09-15 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp:155 +cl::desc("collect control flow for each function"), cl::Hidden, +cl::init(false)); + MaskRay wrote: > false can be removed

[PATCH] D133157: Add -fsanitizer-coverage=control-flow

2022-09-15 Thread Vitaly Buka via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG3e52c0926c22: Add -fsanitizer-coverage=control-flow (authored by Navidem, committed by vitalybuka). Repository: rG LLVM Github Monorepo CHANGES S

[PATCH] D134669: [clang][msan] Turn on -fsanitize-memory-param-retval by default

2022-09-26 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added reviewers: thakis, hans, glider. vitalybuka added a comment. LGTM. I was thinking about this recently as well. Main inconvenience is users like Chromium. They have recompiled libraries. They will need to use -fno-sanitize-memory-param-retval, if recompiling is not an option. R

[PATCH] D134669: [clang][msan] Turn on -fsanitize-memory-param-retval by default

2022-09-26 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. In D134669#3816519 , @aeubanks wrote: > do you want the tests to all properly work with > -fsanitize-memory-param-retval, or just pin them to > -fno-sanitize-memory-param-retval if they're failing? I have some draft patch fo

[PATCH] D134669: [clang][msan] Turn on -fsanitize-memory-param-retval by default

2022-09-26 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added inline comments. Comment at: clang/include/clang/Driver/Options.td:1767 MarshallingInfoEnum, "Global">; defm sanitize_memory_param_retval : BoolFOption<"sanitize-memory-param-retval", you need to update SanitizerArgs::MsanParamRetval

[PATCH] D134669: [clang][msan] Turn on -fsanitize-memory-param-retval by default

2022-09-26 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka updated this revision to Diff 463058. vitalybuka added a comment. Herald added a subscriber: MaskRay. Update Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134669/new/ https://reviews.llvm.org/D134669 Files: clang/include/clang/Driver/

[PATCH] D134669: [clang][msan] Turn on -fsanitize-memory-param-retval by default

2022-09-26 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. diff --git a/clang/test/Driver/fsanitize-memory-param-retval.c b/clang/test/Driver/fsanitize-memory-param-retval.c index d82d20812186..79ade32178b6 100644 --- a/clang/test/Driver/fsanitize-memory-param-retval.c +++ b/clang/test/Driver/fsanitize-memory-param-ret

[PATCH] D134410: [clang][CodeGen] Add noundef metadata to load instructions (preliminary)

2022-09-26 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. Are there patches uploaded with arc tool? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134410/new/ https://reviews.llvm.org/D134410 ___ cfe-commits mailing list cfe-commits@l

[PATCH] D134410: [clang][CodeGen] Add noundef metadata to load instructions (preliminary)

2022-09-26 Thread Vitaly Buka via Phabricator via cfe-commits
vitalybuka added a comment. I tried to hook this patch into MemorySanitizer and it reduces instrumented code by ~30% ! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134410/new/ https://reviews.llvm.org/D134410

<    1   2   3   4   5   6   7   8   >