gcc/libsanitizer/sanitizer_common
Jakub Jelinek 13e44296ea sanitizer: Cherry-pick realpath fix
tsan in some cases starts ignoring interceptors and only calls the
intercepted functions.  But for realpath the behavior for NULL second argument
was only handled in the interceptor and intercepted function was the one
found by dlsym which is often one that doesn't handle NULL as second argument.

Fixed by using dlvsym with "GLIBC_2.3" if possible for intercepted function
and don't emulate behavior in the wrapper.

2021-08-11  Jakub Jelinek  <jakub@redhat.com>

	* sanitizer_common/sanitizer_common_interceptors.inc: Cherry-pick
	llvm-project revision faef0d042f523357fe5590e7cb6a8391cf0351a8.

(cherry picked from commit 0e6017f5b4)
2021-08-12 22:55:01 +02:00
..
Makefile.am libsanitizer: use gnu++14 2020-06-09 10:07:24 +02:00
Makefile.in libsanitizer: Tie the hwasan library into our build system 2020-11-25 16:35:33 +00:00
sancov_flags.cpp Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sancov_flags.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sancov_flags.inc Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_addrhashmap.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_allocator_bytemap.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_allocator_checks.cpp Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_allocator_checks.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_allocator_combined.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_allocator_interface.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_allocator_internal.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_allocator_local_cache.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_allocator_primary32.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_allocator_primary64.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_allocator_report.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_allocator_report.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_allocator_secondary.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_allocator_size_class_map.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_allocator_stats.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_allocator.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_allocator.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_asm.h Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_atomic_clang_mips.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_atomic_clang_other.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_atomic_clang_x86.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_atomic_clang.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_atomic_msvc.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_atomic.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_bitvector.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_bvgraph.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_common_interceptors_format.inc libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_common_interceptors_ioctl.inc libsanitizer: Remove cyclades from libsanitizer 2021-05-21 10:35:29 +01:00
sanitizer_common_interceptors_netbsd_compat.inc Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_common_interceptors_vfork_aarch64.inc.S Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_common_interceptors_vfork_arm.inc.S Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_common_interceptors_vfork_i386.inc.S Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_common_interceptors_vfork_riscv64.inc.S libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_common_interceptors_vfork_x86_64.inc.S Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_common_interceptors.inc sanitizer: Cherry-pick realpath fix 2021-08-12 22:55:01 +02:00
sanitizer_common_interface_posix.inc Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_common_interface.inc Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_common_libcdep.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_common_nolibc.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_common_syscalls.inc libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_common.cpp Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_common.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_coverage_fuchsia.cpp Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_coverage_interface.inc Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_coverage_libcdep_new.cpp Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_coverage_win_dll_thunk.cpp Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_coverage_win_dynamic_runtime_thunk.cpp Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_coverage_win_sections.cpp Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_coverage_win_weak_interception.cpp Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_dbghelp.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_deadlock_detector1.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_deadlock_detector2.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_deadlock_detector_interface.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_deadlock_detector.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_errno_codes.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_errno.cpp Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_errno.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_file.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_file.h Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_flag_parser.cpp Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_flag_parser.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_flags.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_flags.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_flags.inc libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_freebsd.h Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_fuchsia.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_fuchsia.h Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_getauxval.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_glibc_version.h Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_hash.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_interceptors_ioctl_netbsd.inc Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_interface_internal.h Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_internal_defs.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_lfstack.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_libc.cpp Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_libc.h Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_libignore.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_libignore.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_linux_libcdep.cpp libsanitizer: Apply local patches. 2020-11-13 17:29:28 +01:00
sanitizer_linux_s390.cpp Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_linux.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_linux.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_list.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_local_address_space_view.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_mac_libcdep.cpp Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_mac.cpp libsanitizer: Apply local patches. 2020-11-13 17:29:28 +01:00
sanitizer_mac.h libsanitizer: Apply local patches. 2020-11-13 17:29:28 +01:00
sanitizer_malloc_mac.inc Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_mutex.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_netbsd.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_openbsd.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_persistent_allocator.cpp Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_persistent_allocator.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_placement_new.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_platform_interceptors.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_platform_limits_freebsd.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_platform_limits_freebsd.h Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_platform_limits_linux.cpp libsanitizer: Apply local patches. 2020-11-13 17:29:28 +01:00
sanitizer_platform_limits_netbsd.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_platform_limits_netbsd.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_platform_limits_openbsd.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_platform_limits_openbsd.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_platform_limits_posix.cpp libsanitizer: Remove cyclades from libsanitizer 2021-05-21 10:35:29 +01:00
sanitizer_platform_limits_posix.h libsanitizer: Remove cyclades from libsanitizer 2021-05-21 10:35:29 +01:00
sanitizer_platform_limits_solaris.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_platform_limits_solaris.h Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_platform.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_posix_libcdep.cpp sanitizer: cherry pick 414482751452e54710f16bae58458c66298aaf69 2021-08-05 10:45:03 +02:00
sanitizer_posix.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_posix.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_printf.cpp Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_procmaps_bsd.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_procmaps_common.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_procmaps_fuchsia.cpp Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_procmaps_linux.cpp Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_procmaps_mac.cpp Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_procmaps_solaris.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_procmaps.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_ptrauth.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_quarantine.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_report_decorator.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_ring_buffer.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_rtems.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_rtems.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_signal_interceptors.inc libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_solaris.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_stackdepot.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_stackdepot.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_stackdepotbase.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_stacktrace_libcdep.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_stacktrace_printer.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_stacktrace_printer.h libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_stacktrace_sparc.cpp Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_stacktrace.cpp libsanitizer: Apply local patches. 2020-11-13 17:29:28 +01:00
sanitizer_stacktrace.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_stoptheworld_fuchsia.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_stoptheworld_fuchsia.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_stoptheworld_linux_libcdep.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_stoptheworld_mac.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_stoptheworld_netbsd_libcdep.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_stoptheworld.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_suppressions.cpp Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_suppressions.h Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_symbolizer_fuchsia.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_symbolizer_internal.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_symbolizer_libbacktrace.cpp Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_symbolizer_libbacktrace.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_symbolizer_libcdep.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_symbolizer_mac.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_symbolizer_mac.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_symbolizer_markup.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_symbolizer_posix_libcdep.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_symbolizer_report.cpp libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_symbolizer_rtems.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_symbolizer_win.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_symbolizer.cpp Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_symbolizer.h Libsanitizer: merge from master. 2020-06-02 08:02:07 +02:00
sanitizer_syscall_generic.inc libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_syscall_linux_aarch64.inc Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_syscall_linux_arm.inc Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_syscall_linux_riscv64.inc libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_syscall_linux_x86_64.inc Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_syscalls_netbsd.inc libsanitizer: merge from master 2020-10-16 10:57:03 +02:00
sanitizer_termination.cpp Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_thread_registry.cpp Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_thread_registry.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_tls_get_addr.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_tls_get_addr.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_type_traits.cpp Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_type_traits.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_unwind_linux_libcdep.cpp Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_unwind_win.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_vector.h Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_win_defs.h Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_win_dll_thunk.cpp Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_win_dll_thunk.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_win_dynamic_runtime_thunk.cpp Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_win_weak_interception.cpp Libsanitizer: merge from trunk with merge.sh. 2019-11-05 13:54:57 +00:00
sanitizer_win_weak_interception.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00
sanitizer_win.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_win.h Libsanitizer merge from trunk r368656. 2019-08-14 08:47:11 +00:00