sanitizer: Cherry-pick realpath fix
authorJakub Jelinek <jakub@redhat.com>
Wed, 11 Aug 2021 08:23:34 +0000 (10:23 +0200)
committerJakub Jelinek <jakub@redhat.com>
Wed, 11 Aug 2021 08:23:34 +0000 (10:23 +0200)
commit0e6017f5b4f13906dd2c09b25403ffa94a80181f
treea07b36bfa3f2b5f40efa235ed6f6de93ee507578
parenta45918f8a7444a40eb397a037683ba5900a2db74
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.
libsanitizer/sanitizer_common/sanitizer_common_interceptors.inc