- Jan 07, 2025
-
-
GCC Administrator authored
-
- Jan 06, 2025
-
-
Stefan Schulze Frielinghaus authored
This is a follow-up to 6dec33834d1fd89f16e271dde9607c1de9554144 and pull requests #116957 and #119114. Cherry picked from LLVM commit 65a2eb0b1589590ae78cc1e5f05cd004b3b3bec5. libsanitizer/ChangeLog: PR sanitizer/117725 * sanitizer_common/sanitizer_common_interceptors.inc: Cherry picked from LLVM commit 65a2eb0b1589590ae78cc1e5f05cd004b3b3bec5.
-
Vitaly Buka authored
Fix type in a few related Min() calls. Follow up to #116957. Cherry picked from LLVM commit 6dec33834d1fd89f16e271dde9607c1de9554144 (removed memprof part). libsanitizer/ChangeLog: PR sanitizer/117725 * asan/asan_interceptors.cpp: Cherry picked from LLVM commit 6dec33834d1fd89f16e271dde9607c1de9554144. * sanitizer_common/sanitizer_common_interceptors.inc: Ditto. Co-authored-by:
Stefan Schulze Frielinghaus <stefansf@linux.ibm.com>
-
Stefan Schulze Frielinghaus authored
Since the sanitizer merge in commit r15-5164-gfa321004f3f628 of GCC which entails LLVM commit 61a6439f35b6de28ff4aff4450d6fca970292fd5, GCCs bootstrap is broken on s390 -m31. This is due to commit ec68dc1ca4d967b599f1202855917d5ec9cae52f which introduces stricter type checking which is why GCC bootstrap fails with ``` In file included from /gcc/src/libsanitizer/interception/interception.h:18, from /gcc/src/libsanitizer/interception/interception_type_test.cpp:14: /gcc/src/libsanitizer/interception/interception_type_test.cpp:30:61: error: static assertion failed 30 | COMPILER_CHECK((__sanitizer::is_same<::SSIZE_T, ::ssize_t>::value)); | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~ /gcc/src/libsanitizer/sanitizer_common/sanitizer_internal_defs.h:363:44: note: in definition of macro 'COMPILER_CHECK' 363 | #define COMPILER_CHECK(pred) static_assert(pred, "") | ^~~~ make[8]: *** [Makefile:469: interception_type_test.lo] Error 1 ``` The culprit seems to be that we don't check for equality of type sizes anymore but rather whether the types are indeed the same. On s390 -m31 we have that `sizeof(int)==sizeof(long)` holds which is why previously the checks succeeded. They fail now because ``` size_t => unsigned long ssize_t => long ptrdiff_t => int ::SSIZE_T => __sanitizer::sptr => int ::PTRDIFF_T => __sanitizer::sptr => int ``` This is fixed by mapping `SSIZE_T` to `long` in the end. ``` typedef long ssize; typedef sptr ssize; ``` Cherry picked from LLVM commit ce44640fe29550461120d22b0358e6cac4aed822. libsanitizer/ChangeLog: PR sanitizer/117725 * interception/interception.h: Cherry picked from LLVM commit ce44640fe29550461120d22b0358e6cac4aed822. * sanitizer_common/sanitizer_internal_defs.h: Ditto.
-
Stefan Schulze Frielinghaus authored
For some targets uptr is mapped to unsigned int and size_t to unsigned long and sizeof(int)==sizeof(long) holds. Still, these are distinct types and type checking may fail. Therefore, replace uptr by usize/SIZE_T wherever a size_t is expected. Part of #116957 Cherry picked from LLVM commit 9a156f6b2b0c892d8713ba907f07f027b24953d8 (removed memprof, msan, and nsan parts). libsanitizer/ChangeLog: PR sanitizer/117725 * asan/asan_interceptors.cpp: Cherry picked LLVM commit 9a156f6b2b0c892d8713ba907f07f027b24953d8. * asan/asan_interceptors.h: Ditto. * asan/asan_interceptors_memintrinsics.h: Ditto. * sanitizer_common/sanitizer_common_interceptors.inc: Ditto. * sanitizer_common/sanitizer_common_interceptors_memintrinsics.inc: Ditto. * sanitizer_common/sanitizer_platform_limits_posix.h: Ditto. * tsan/tsan_interceptors_posix.cpp: Ditto.
-
- Nov 26, 2024
-
-
GCC Administrator authored
-
- Nov 25, 2024
-
-
Jakub Jelinek authored
We aren't the master repository for the sanitizers and clearly upstream introduces various extensions in the code. All we care about is whether it builds and works fine with GCC, so -pedantic flag is of no use to us, only maybe to upstream if they cared about it (which they clearly don't). The following patch removes those and fixes some whitespace nits at the same time. 2024-11-25 Jakub Jelinek <jakub@redhat.com> PR sanitizer/117732 * asan/Makefile.am (AM_CXXFLAGS): Remove -pedantic. Formatting fix. (asan_files): Formatting fix. * hwasan/Makefile.am (AM_CXXFLAGS): Remove -pedantic. Formatting fix. * interception/Makefile.am (AM_CXXFLAGS): Likewise. (interception_files): Formatting fix. * libbacktrace/Makefile.am: Update copyright years. * lsan/Makefile.am (AM_CXXFLAGS): Remove -pedantic. Formatting fix. * sanitizer_common/Makefile.am (AM_CXXFLAGS): Likewise. (libsanitizer_common_la_DEPENDENCIES): Formatting fix. * tsan/Makefile.am (AM_CXXFLAGS): Remove -pedantic. Formatting fix. * ubsan/Makefile.am (AM_CXXFLAGS): Likewise. * asan/Makefile.in: Regenerate. * hwasan/Makefile.in: Regenerate. * interception/Makefile.in: Regenerate. * libbacktrace/Makefile.in: Regenerate. * lsan/Makefile.in: Regenerate. * sanitizer_common/Makefile.in: Regenerate. * tsan/Makefile.in: Regenerate. * ubsan/Makefile.in: Regenerate.
-
- Nov 23, 2024
-
-
GCC Administrator authored
-
- Nov 22, 2024
-
-
Andrew Pinski authored
While compiling libsanitizer for aarch64-linux-gnu, I noticed the new warning: ``` ../../../../libsanitizer/asan/asan_interceptors.cpp: In function ‘char* ___interceptor_strcpy(char*, const char*)’: ../../../../libsanitizer/asan/asan_interceptors.cpp:554:6: warning: ‘if constexpr’ only available with ‘-std=c++17’ or ‘-std=gnu++17’ [-Wc++17-extensions] 554 | if constexpr (SANITIZER_APPLE) { | ^~~~~~~~~ ``` So compile-rt upstream compiles this as gnu++17 (the current defualt for clang), so let's update it to be similar. Build and tested on aarch64-linux-gnu. PR sanitizer/117731 libsanitizer/ChangeLog: * asan/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17. * asan/Makefile.in: Regenerate. * hwasan/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17. * hwasan/Makefile.in: Regenerate. * interception/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17. * interception/Makefile.in: Regenerate. * libbacktrace/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17. * libbacktrace/Makefile.in (AM_CXXFLAGS): Regenerate. * lsan/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17. * lsan/Makefile.in: Regenerate. * sanitizer_common/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17. * sanitizer_common/Makefile.in: Regenerate. * tsan/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17. * tsan/Makefile.in: Regenerate. * ubsan/Makefile.am (AM_CXXFLAGS): Replace gnu++14 with gnu++17. * ubsan/Makefile.in: Regenerate. Signed-off-by:
Andrew Pinski <quic_apinski@quicinc.com>
-
- Nov 12, 2024
-
-
Kito Cheng authored
-
Kito Cheng authored
`FrameIsInternal` is a function that improves report quality by filtering out internal functions from the sanitizer, allowing it to point to a more precise root cause. However, the current checks are mostly specific to compiler-rt, so we are adding a few more rules to enhance the filtering for libsanitizer as well.
-
Kito Cheng authored
This patch just reapplies local patches (will be noted in LOCAL_PATCHES).
-
Kito Cheng authored
-
- Sep 06, 2024
-
-
GCC Administrator authored
-
- Sep 05, 2024
-
-
Jakub Jelinek authored
When gcc is built with -mbranch-protection=standard, running sanitized programs doesn't work properly on bti enabled kernels. This has been fixed upstream with https://github.com/llvm/llvm-project/pull/84061 The following patch cherry picks that from upstream. For trunk we should eventually do a full merge from upstream, but I'm hoping they will first fix up the _BitInt libubsan support mess. 2024-09-05 Jakub Jelinek <jakub@redhat.com> * sanitizer_common/sanitizer_asm.h: Cherry-pick llvm-project revision 1c792d24e0a228ad49cc004a1c26bbd7cd87f030. * interception/interception.h: Likewise.
-
- Feb 17, 2024
-
-
GCC Administrator authored
-
- Feb 16, 2024
-
-
Rainer Orth authored
c-c++-common/asan/swapcontext-test-1.c FAILs on Solaris/SPARC: FAIL: c-c++-common/asan/swapcontext-test-1.c -O0 execution test FAIL: c-c++-common/asan/swapcontext-test-1.c -O1 execution test FAIL: c-c++-common/asan/swapcontext-test-1.c -O2 execution test FAIL: c-c++-common/asan/swapcontext-test-1.c -O2 -flto execution test FAIL: c-c++-common/asan/swapcontext-test-1.c -O2 -flto -flto-partition=none execution test FAIL: c-c++-common/asan/swapcontext-test-1.c -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions execution test FAIL: c-c++-common/asan/swapcontext-test-1.c -O3 -g execution test FAIL: c-c++-common/asan/swapcontext-test-1.c -Os execution test As detailed in PR sanitizer/113785, this happens because an ABI change in Solaris 10/SPARC caused the external symbol for makecontext to be changed to __makecontext_v2, which isn't intercepted. The following patch, submitted upstream at https://github.com/llvm/llvm-project/pull/81588, fixes that. Tested on sparc-sun-solaris2.11 and i386-pc-solaris2.11. 2024-02-16 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> libsanitizer: PR sanitizer/113785 * asan/asan_interceptors.cpp: Cherry-pick llvm-project revision 8c2033719a843a1880427a5e8caa5563248bce78.
-
- Feb 07, 2024
-
-
GCC Administrator authored
-
- Feb 06, 2024
-
-
chenguoqi authored
libsanitizer/ChangeLog: * configure.tgt: Enable tsan and lsan for loongarch64. * tsan/Makefile.am (EXTRA_libtsan_la_SOURCES): Add tsan_rtl_loongarch64.S. * tsan/Makefile.in: Regenerate.
-
- Jan 31, 2024
-
-
Tamar Christina authored
This cherry-picks and squashes the differences between commits d3e5c20ab846303874a2a25e5877c72271fc798b..76e1e45922e6709392fb82aac44bebe3dbc2ea63 from LLVM upstream from compiler-rt/lib/hwasan/ to GCC on the changes relevant for GCC. This is required to fix the linked PR. As mentioned in the PR the last sync brought in a bug from upstream[1] where operations became non-recoverable and as such the tests in AArch64 started failing. This cherry picks the fix and there are minor updates needed to GCC after this to fix the cases. [1] https://github.com/llvm/llvm-project/pull/74000 PR sanitizer/112644 Cherry-pick llvm-project revision 672b71cc1003533460a82f06b7d24fbdc02ffd58, 5fcf3bbb1acfe226572474636714ede86fffcce8, 3bded112d02632209bd55fb28c6c5c234c23dec3 and 76e1e45922e6709392fb82aac44bebe3dbc2ea63.
-
- Jan 20, 2024
-
-
GCC Administrator authored
-
- Jan 19, 2024
-
-
Daniel Cederman authored
When GCC is configured with --enable-target-optspace the compiler generates a memcpy call in the Symbolizer constructor in sanitizer_symbolizer.cpp when compiling for SPARC V8. Add HAVE_AS_SYM_ASSIGN to replace it with a call to __sanitizer_internal_memcpy. libsanitizer/ChangeLog: * sanitizer_common/Makefile.am (DEFS): Add @AS_SYM_ASSIGN_DEFS@. * sanitizer_common/Makefile.in: Regenerate.
-
- Jan 18, 2024
-
-
GCC Administrator authored
-
- Jan 17, 2024
-
-
YunQiang Su authored
Currently, almost all of the shared libraries of MIPS, rely on $t9 to get the address of current function, instead of PCREL instructions, even on MIPSr6. So we have to set $t9 properly. To get the address of preemptible function, we need the help of GOT. MIPS/O32 has .cpload, which can help to generate 3 instructions to get GOT. For __mips64, we can get GOT by: lui $t8, %hi(%neg(%gp_rel(SANITIZER_STRINGIFY(TRAMPOLINE(func))))) daddu $t8, $t8, $t9 daddiu $t8, $t8, %hi(%neg(%gp_rel(SANITIZER_STRINGIFY(TRAMPOLINE(func))))) And then get the address of __interceptor_func, and jump to it ld $t9, %got_disp(_interceptor" SANITIZER_STRINGIFY(func) ")($t8) jr $t9 Upstream-Commit: 0a64367a72f1634321f5051221f05f2f364bd882 libsanitizer * interception/interception.h (substitution_##func_name): Use macro C_ASM_TAIL_CALL. * sanitizer_common/sanitizer_asm.h: Define C_ASM_TAIL_CALL for MIPS with help of t9.
-
- Jan 03, 2024
-
-
GCC Administrator authored
-
- Jan 02, 2024
-
-
Andreas Schwab authored
libsanitizer: * configure.tgt (riscv64-*-linux*): Enable LSan and TSan.
-
- Nov 29, 2023
-
-
GCC Administrator authored
-
- Nov 28, 2023
-
-
Rainer Orth authored
2023-11-28 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> libsanitizer: * LOCAL_PATCHES: Update.
-
Rainer Orth authored
This patch only enables symbol assignment if the configure test determined it's supported. Bootstrapped without regressions on sparc-sun-solaris2.11 (as and gas) and i386-pc-solaris2.11 (as and gas). 2023-11-23 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> libsanitizer: PR sanitizer/112563 * sanitizer_common/sanitizer_redefine_builtins.h: Check HAVE_AS_SYM_ASSIGN.
-
Rainer Orth authored
The recent libsanitizer import broke the build on Solaris/SPARC with the native as: /usr/ccs/bin/as: ".libs/sanitizer_errno.s", line 4247: error: symbol "__sanitizer_internal_memset" is used but not defined /usr/ccs/bin/as: ".libs/sanitizer_errno.s", line 4247: error: symbol "__sanitizer_internal_memcpy" is used but not defined /usr/ccs/bin/as: ".libs/sanitizer_errno.s", line 4247: error: symbol "__sanitizer_internal_memmove" is used but not defined Since none of the alternatives considered in the PR worked out, this patch checks if the assembler does support symbol assignment, disabling the code otherwise. This returns the code to the way it was up to LLVM 16. Bootstrapped without regressions on sparc-sun-solaris2.11 (as and gas) and i386-pc-solaris2.11 (as and gas). 2023-11-23 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> libsanitizer: PR sanitizer/112563 * configure.ac (libsanitizer_cv_as_sym_assign): Check for assembler symbol assignment support. * configure: Regenerate. * asan/Makefile.am (DEFS): Add @AS_SYM_ASSIGN_DEFS@. * Makefile.in, asan/Makefile.in, hwasan/Makefile.in, interception/Makefile.in, libbacktrace/Makefile.in, lsan/Makefile.in, sanitizer_common/Makefile.in, tsan/Makefile.in, ubsan/Makefile.in: Regenerate.
-
- Nov 22, 2023
-
-
GCC Administrator authored
-
- Nov 21, 2023
-
-
Jakub Jelinek authored
Solaris as apparently doesn't accept %function and requires @function instead. This cherry-picks upstream commit. 2023-11-21 Jakub Jelinek <jakub@redhat.com> PR sanitizer/112562 * sanitizer_common/sanitizer_asm.h: Cherry-pick llvm-project revision a855a16a02e76a0f4192c038bb64f3773947a2f7. * interception/interception.h: Likewise.
-
- Nov 19, 2023
-
-
GCC Administrator authored
-
- Nov 18, 2023
-
-
Francois-Xavier Coudert authored
Upstream report of the issue at https://github.com/llvm/llvm-project/issues/72639 libsanitizer/ChangeLog: * asan/asan_mac.cpp: Protect Apple blocks behind the MISSING_BLOCKS_SUPPORT macro.
-
- Nov 16, 2023
-
-
GCC Administrator authored
-
- Nov 15, 2023
-
-
Jakub Jelinek authored
2023-11-15 Jakub Jelinek <jakub@redhat.com> * LOCAL_PATCHES: Update revisions.
-
Jakub Jelinek authored
So that we don't have to bump libubsan.so.1 SONAME, the following patch reverts part of the changes which removed two handlers. While we don't actually use them from GCC, we shouldn't remove supported entrypoints unless SONAME is changed (removal of __interceptor_* or ___interceptor_* is fine). This is the only removal, other libraries just added some symbols. 2023-11-15 Jakub Jelinek <jakub@redhat.com> * ubsan/ubsan_handlers_cxx.h (FunctionTypeMismatchData): Forward declare. (__ubsan_handle_function_type_mismatch_v1, __ubsan_handle_function_type_mismatch_v1_abort): Declare. * ubsan/ubsan_handlers_cxx.cpp (handleFunctionTypeMismatch, __ubsan_handle_function_type_mismatch_v1, __ubsan_handle_function_type_mismatch_v1_abort): New functions readded for backwards compatibility from older ubsan. * ubsan/ubsan_interface.inc (__ubsan_handle_function_type_mismatch_v1, __ubsan_handle_function_type_mismatch_v1_abort): Readd.
-
Jakub Jelinek authored
This patch just reapplies local patches (will be noted in LOCAL_PATCHES).
-
Jakub Jelinek authored
The following patch is result of libsanitizer/merge.sh from c425db2eb558c263 (yesterday evening). Bootstrapped/regtested on x86_64-linux and i686-linux (together with the follow-up 3 patches I'm about to post). BTW, seems upstream has added riscv64 support for I think lsan/tsan, so if anyone is willing to try it there, it would be a matter of copying e.g. the s390*-*-linux* libsanitizer/configure.tgt entry to riscv64-*-linux* with the obvious s/s390x/riscv64/ change in it.
-
- Oct 23, 2023
-
-
GCC Administrator authored
-