gcc/libsanitizer/sanitizer_common
Jakub Jelinek 0e6017f5b4 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.
2021-08-11 10:23:34 +02:00
..
Makefile.am libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
Makefile.in libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sancov_flags.cpp
sancov_flags.h
sancov_flags.inc
sanitizer_addrhashmap.h libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_allocator_bytemap.h
sanitizer_allocator_checks.cpp
sanitizer_allocator_checks.h
sanitizer_allocator_combined.h libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_allocator_interface.h
sanitizer_allocator_internal.h
sanitizer_allocator_local_cache.h libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_allocator_primary32.h libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_allocator_primary64.h libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07: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 with upstream 2021-07-20 14:21:51 -07:00
sanitizer_allocator_size_class_map.h libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_allocator_stats.h
sanitizer_allocator.cpp libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_allocator.h
sanitizer_asm.h
sanitizer_atomic_clang_mips.h libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_atomic_clang_other.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_atomic_clang_x86.h
sanitizer_atomic_clang.h
sanitizer_atomic_msvc.h
sanitizer_atomic.h
sanitizer_bitvector.h
sanitizer_bvgraph.h
sanitizer_chained_origin_depot.cpp libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_chained_origin_depot.h libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_common_interceptors_format.inc
sanitizer_common_interceptors_ioctl.inc libsanitizer: Remove cyclades from libsanitizer 2021-05-21 10:30:59 +01:00
sanitizer_common_interceptors_netbsd_compat.inc
sanitizer_common_interceptors_vfork_aarch64.inc.S libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_common_interceptors_vfork_arm.inc.S
sanitizer_common_interceptors_vfork_i386.inc.S
sanitizer_common_interceptors_vfork_riscv64.inc.S
sanitizer_common_interceptors_vfork_x86_64.inc.S
sanitizer_common_interceptors.inc sanitizer: Cherry-pick realpath fix 2021-08-11 10:23:34 +02:00
sanitizer_common_interface_posix.inc
sanitizer_common_interface.inc libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_common_libcdep.cpp libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_common_nolibc.cpp libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_common_syscalls.inc
sanitizer_common.cpp libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_common.h libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_coverage_fuchsia.cpp
sanitizer_coverage_interface.inc
sanitizer_coverage_libcdep_new.cpp
sanitizer_coverage_win_dll_thunk.cpp
sanitizer_coverage_win_dynamic_runtime_thunk.cpp
sanitizer_coverage_win_sections.cpp
sanitizer_coverage_win_weak_interception.cpp
sanitizer_dbghelp.h
sanitizer_deadlock_detector1.cpp libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_deadlock_detector2.cpp libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_deadlock_detector_interface.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_deadlock_detector.h
sanitizer_errno_codes.h
sanitizer_errno.cpp
sanitizer_errno.h libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_file.cpp libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_file.h libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_flag_parser.cpp
sanitizer_flag_parser.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_flags.cpp libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_flags.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_flags.inc libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_freebsd.h
sanitizer_fuchsia.cpp libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_fuchsia.h libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_getauxval.h
sanitizer_glibc_version.h
sanitizer_hash.h
sanitizer_interceptors_ioctl_netbsd.inc
sanitizer_interface_internal.h libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_internal_defs.h libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_lfstack.h
sanitizer_libc.cpp
sanitizer_libc.h libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_libignore.cpp libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_libignore.h libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_linux_libcdep.cpp libsanitizer: Apply local patches 2021-07-20 14:21:51 -07:00
sanitizer_linux_s390.cpp
sanitizer_linux.cpp libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_linux.h libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_list.h
sanitizer_local_address_space_view.h libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_mac_libcdep.cpp
sanitizer_mac.cpp libsanitizer: Apply local patches 2021-07-20 14:21:51 -07:00
sanitizer_mac.h libsanitizer: Apply local patches 2021-07-20 14:21:51 -07:00
sanitizer_malloc_mac.inc libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_mutex.cpp libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_mutex.h libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_netbsd.cpp libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_openbsd.cpp libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_persistent_allocator.cpp
sanitizer_persistent_allocator.h
sanitizer_placement_new.h
sanitizer_platform_interceptors.h libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_platform_limits_freebsd.cpp libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_platform_limits_freebsd.h
sanitizer_platform_limits_linux.cpp libsanitizer: Apply local patches 2021-07-20 14:21:51 -07:00
sanitizer_platform_limits_netbsd.cpp
sanitizer_platform_limits_netbsd.h
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:30:59 +01:00
sanitizer_platform_limits_posix.h libsanitizer: Apply local patches 2021-07-20 14:21:51 -07:00
sanitizer_platform_limits_solaris.cpp
sanitizer_platform_limits_solaris.h
sanitizer_platform.h libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_posix_libcdep.cpp libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_posix.cpp libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_posix.h libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_printf.cpp libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07: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 2021-05-13 09:29:17 +02:00
sanitizer_procmaps_fuchsia.cpp
sanitizer_procmaps_linux.cpp
sanitizer_procmaps_mac.cpp libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_procmaps_solaris.cpp libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_procmaps.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_ptrauth.h libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_quarantine.h libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_report_decorator.h
sanitizer_ring_buffer.h
sanitizer_signal_interceptors.inc
sanitizer_solaris.cpp libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_stackdepot.cpp libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_stackdepot.h
sanitizer_stackdepotbase.h
sanitizer_stacktrace_libcdep.cpp libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_stacktrace_printer.cpp
sanitizer_stacktrace_printer.h
sanitizer_stacktrace_sparc.cpp
sanitizer_stacktrace.cpp libsanitizer: Apply local patches 2021-07-20 14:21:51 -07:00
sanitizer_stacktrace.h libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07: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 2021-05-13 09:29:17 +02: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 master 2021-05-13 09:29:17 +02:00
sanitizer_suppressions.h
sanitizer_symbolizer_fuchsia.h
sanitizer_symbolizer_internal.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_symbolizer_libbacktrace.cpp
sanitizer_symbolizer_libbacktrace.h libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_symbolizer_libcdep.cpp libsanitizer: merge from master 2021-05-13 09:29:17 +02: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 with upstream 2021-07-20 14:21:51 -07:00
sanitizer_symbolizer_posix_libcdep.cpp libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_symbolizer_report.cpp libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_symbolizer_win.cpp libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_symbolizer.cpp
sanitizer_symbolizer.h
sanitizer_syscall_generic.inc libsanitizer: merge from master. 2020-11-13 17:28:49 +01:00
sanitizer_syscall_linux_aarch64.inc
sanitizer_syscall_linux_arm.inc
sanitizer_syscall_linux_riscv64.inc
sanitizer_syscall_linux_x86_64.inc
sanitizer_syscalls_netbsd.inc
sanitizer_termination.cpp libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_thread_registry.cpp libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_thread_registry.h libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_thread_safety.h libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_tls_get_addr.cpp libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_tls_get_addr.h libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_type_traits.cpp
sanitizer_type_traits.h
sanitizer_unwind_linux_libcdep.cpp
sanitizer_unwind_win.cpp libsanitizer: merge from master 2021-05-13 09:29:17 +02:00
sanitizer_vector.h
sanitizer_win_defs.h
sanitizer_win_dll_thunk.cpp
sanitizer_win_dll_thunk.h
sanitizer_win_dynamic_runtime_thunk.cpp
sanitizer_win_weak_interception.cpp
sanitizer_win_weak_interception.h
sanitizer_win.cpp libsanitizer: Merge with upstream 2021-07-20 14:21:51 -07:00
sanitizer_win.h