[llvm-branch-commits] [NFC][sanitizer] Move ThreadDescriptorSize into GLIBC/FREEBSD block (PR #108913)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/108913 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [NFC][sanitizer] Remove `else if` from ThreadDescriptorSizeFallback (PR #108909)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/108909 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [sanitizer] Add CHECK that static TLS info is ready (PR #108684)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/108684 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [NFC][sanitizer] Switch to `gnu_get_libc_version` (PR #108724)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/108724 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [sanitizer] Test for #108348 (PR #108349)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/108349 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [sanitizer] Allow to override GetDTLSRange (PR #108348)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/108348 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] Reland "[asan] Catch `initialization-order-fiasco` in modules without…" (PR #104730)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/104730 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [NFC][asan] Don't `cd` after `split-file` (PR #104727)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/104727 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [NFC][asan] Create `ModuleName` lazily (PR #104729)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/104729 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [NFC][asan] Better `___asan_gen_` names (PR #104728)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/104728 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [asan] Remove debug tracing from `report_globals` (PR #104404)
@@ -4,7 +4,7 @@ // RUN: %clangxx_asan -g -O0 -DSHARED_LIB -DSIZE=1 %s -fPIC -shared -o %t-so-1.so // RUN: %clangxx_asan -g -O0 -DSHARED_LIB -DSIZE=2 %s -fPIC -shared -o %t-so-2.so // RUN: %clangxx_asan -g -O0 %s %libdl -Wl,--export-dynamic -o %t -// RUN: %env_asan_opts=report_globals=2:detect_odr_violation=1 %run %t 2>&1 | FileCheck %s +// RUN: %env_asan_opts=report_globals=1:detect_odr_violation=1:verbosity=4 %run %t 2>&1 | FileCheck %s thurstond wrote: Is there a particular reason why this uses verbosity=4 instead of 3? (it's the same output since verbosity >= 3, but a bit perplexing since nothing is gated on verbosity >= 4) https://github.com/llvm/llvm-project/pull/104404 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [asan] Remove debug tracing from `report_globals` (PR #104404)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/104404 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [NFC][sanitizer] Use `UNLIKELY` in VReport/VPrintf (PR #104403)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/104403 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [asan] Reduce priority of "contiguous_container:" VPrintf (PR #104402)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/104402 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [NFC][asan] Track current dynamic init module (PR #101597)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/101597 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [ModuleUtils] Add updateGlobalCtors/updateGlobalDtors (PR #101757)
@@ -44,6 +45,14 @@ void appendToGlobalCtors(Module &M, Function *F, int Priority, void appendToGlobalDtors(Module &M, Function *F, int Priority, Constant *Data = nullptr); +/// Apply 'Fn' to the list of global ctors of module M and replace contructor +/// record with the one returned by `Fn`. If `nullptr` was returned, the +/// corresponding constructor will be removed from the array. For details see +/// https://llvm.org/docs/LangRef.html#the-llvm-global-ctors-global-variable +using GlobalCtorUpdateFn = llvm::function_ref; +void updateGlobalCtors(Module &M, const GlobalCtorUpdateFn &Fn); thurstond wrote: 'updateGlobalCtors' is a very generic name - is there a name that could be descriptive? (e.g., it's somewhat similar to 'map' in Haskell/Python or std::transform.) https://github.com/llvm/llvm-project/pull/101757 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [ModuleUtils] Add updateGlobalCtors/updateGlobalDtors (PR #101757)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/101757 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [NFC][asan] Report DynInitUnPoison (PR #101586)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/101586 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [docs] Fix code-block formating (PR #100772)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/100772 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [InstCombine][asan] Don't speculate loads before `select ptr` (PR #100773)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/100773 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [NFC][ubsan] Add mixed filter test case (PR #100679)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/100679 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [NFC][hwasan] Remove duplicated checks (PR #100678)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/100678 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [tsan] Replace ALIGNED with alignas (PR #98959)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/98959 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [NFC][sanitizer_common] Use %p to print addresses (PR #98578)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/98578 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [NFC][hwasan] Use %p to print addresses (PR #98576)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/98576 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [nfc][tsan] Clang format includes (PR #96599)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/96599 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [NFC][msan] Prepare function to extract main logic (PR #94880)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/94880 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [NFC][msan] Extract `handleSelectLikeInst` (PR #94881)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/94881 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang] [clang][builtin] Implement __builtin_allow_runtime_check (PR #87568)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/87568 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] release/18.x: [msan] Re-exec with no ASLR if memory layout is incompatible on Linux (#85142) (PR #86201)
thurstond wrote: > Hi @thurstond (or anyone else). If you would like to add a note about this > fix in the release notes (completely optional). Please reply to this comment > with a one or two sentence description of the fix. "MemorySanitizer on Linux can now run even when maximum-entropy address-space layout randomization is configured globally (as is becoming increasingly common); MSan can automatically re-exec ASLR-off for the process if needed, instead of aborting." Thanks @tstellar! https://github.com/llvm/llvm-project/pull/86201 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [HWASAN] Don't instrument loads from global if globals are not tagged (PR #86774)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/86774 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [tsan] Process SIGPROF as sync signal only if thread is alive (PR #86343)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/86343 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [tsan] Set `thr->is_inited` after SlotAttachAndLock (PR #86342)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/86342 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] release/18.x: [msan] Re-exec with no ASLR if memory layout is incompatible on Linux (#85142) (PR #86201)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/86201 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [libc] [llvm] [libcxx] [libunwind] [clang] [compiler-rt] [tsan] Fallback to top frame (PR #77145)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/77145 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [tsan] Fallback to top frame (PR #77145)
thurstond wrote: > Probably it's not important, as it should not happen, but if all frames are > internal we should pick top, not the bottom frame. If we encounter a case that "should not happen", wouldn't it be better to fail/assert? https://github.com/llvm/llvm-project/pull/77145 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [NFC][tsan] `ptr != 0` to implicit check (PR #77144)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/77144 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [clang] [hwasan] Respect strip_path_prefix printing locals (PR #76132)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/76132 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] [clang] [compiler-rt] [clang-tools-extra] [llvm] [libcxx] [test][hwasan] Implement sanitizer_specific for HWASAN (PR #75280)
@@ -31,6 +31,30 @@ static void make_mem_good(void *p, size_t s) { static void make_mem_bad(void *p, size_t s) { __asan_poison_memory_region(p, s); } +#elif __has_feature(hwaddress_sanitizer) +# include +# include +static void check_mem_is_good(void *p, size_t s) { + if (__hwasan_test_shadow(p, s) != -1) +abort(); +} +static void make_mem_good(void *p, size_t s) { + __hwasan_tag_memory(p, __hwasan_get_tag_from_pointer(p), s); +} +static void make_mem_bad(void *p, size_t s) { + uint8_t tag = ~__hwasan_get_tag_from_pointer(p); + if (!tag) { +// Nothing wrong with tag zero, but non-zero tags help to detect never +// tagged memory. +tag = 1; + } + __hwasan_tag_memory(p, , s); + // With missaligned `p` or short granules we can't guaranlee tag mismatch. thurstond wrote: Nits: "misaligned", "guaranlee" https://github.com/llvm/llvm-project/pull/75280 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [lld] [libcxx] [llvm] [compiler-rt] [clang-tools-extra] [clang] [test][hwasan] Implement sanitizer_specific for HWASAN (PR #75280)
@@ -42,7 +42,18 @@ static void make_mem_good(void *p, size_t s) { __hwasan_tag_memory(p, __hwasan_get_tag_from_pointer(p), s); } static void make_mem_bad(void *p, size_t s) { - __hwasan_tag_memory(p, ~__hwasan_get_tag_from_pointer(p), s); + uint8_t tag = ~__hwasan_get_tag_from_pointer(p); + if (!tag) { +// Nothing wrong with tag zero, but non-zero tags help to detect never +// tagged memory. +tag = 1; + } + __hwasan_tag_memory(p, , s); thurstond wrote: Is this missing the tag parameter? https://github.com/llvm/llvm-project/pull/75280 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [asan] Install `pthread_atfork` (PR #75290)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/75290 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [asan] Install `pthread_atfork` (PR #75290)
@@ -148,6 +148,30 @@ void PlatformTSDDtor(void *tsd) { } #endif +void InstallAtForkHandler() { + auto before = []() { +if (CAN_SANITIZE_LEAKS) { + __lsan::LockGlobal(); +} +// `_lsan` functions defined regardless of `CAN_SANITIZE_LEAKS` and do the +// job. thurstond wrote: Not sure what "and do the job" means. https://github.com/llvm/llvm-project/pull/75290 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [asan] Install `pthread_atfork` (PR #75290)
https://github.com/thurstond edited https://github.com/llvm/llvm-project/pull/75290 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang-tools-extra] [lld] [libcxx] [compiler-rt] [llvm] [lsan] Install `pthread_atfork` (PR #75281)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/75281 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [clang-tools-extra] [lld] [libcxx] [compiler-rt] [llvm] [test][hwasan] Implement sanitizer_specific for HWASAN (PR #75280)
@@ -31,6 +31,19 @@ static void make_mem_good(void *p, size_t s) { static void make_mem_bad(void *p, size_t s) { __asan_poison_memory_region(p, s); } +#elif __has_feature(hwaddress_sanitizer) +# include +# include +static void check_mem_is_good(void *p, size_t s) { + if (__hwasan_test_shadow(p, s) != -1) +abort(); +} +static void make_mem_good(void *p, size_t s) { + __hwasan_tag_memory(p, __hwasan_get_tag_from_pointer(p), s); +} +static void make_mem_bad(void *p, size_t s) { + __hwasan_tag_memory(p, ~__hwasan_get_tag_from_pointer(p), s); thurstond wrote: Is this guaranteed to make memory bad if it's a short granule? Also, in the rare case where the tag was 255, bitwise NOT results in the confusing tag value of zero. https://github.com/llvm/llvm-project/pull/75280 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [test][sanitizer] Allow fork_threaded test on Msan, Tsan (PR #75260)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/75260 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [test][sanitizer] Allow fork_threaded test on Msan, Tsan (PR #75260)
https://github.com/thurstond edited https://github.com/llvm/llvm-project/pull/75260 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [compiler-rt] [test][sanitizer] Allow fork_threaded test on Msan, Tsan (PR #75260)
@@ -1,6 +1,6 @@ // RUN: %clangxx -O0 %s -o %t && %env_tool_opts=die_after_fork=0 %run %t -// UNSUPPORTED: * +// UNSUPPORTED: asan, lsan, hwasan thurstond wrote: This would also enable the test for ubsan, which is not mentioned in the title https://github.com/llvm/llvm-project/pull/75260 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [compiler-rt] [msan][x86] Fix shadow if vararg overflow beyond kParamTLSSize (PR #72707)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/72707 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits
[llvm-branch-commits] [llvm] [NFC][msan] Remove unused parameter from getOriginPtrForVAArgument (PR #72687)
https://github.com/thurstond approved this pull request. https://github.com/llvm/llvm-project/pull/72687 ___ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits