Commit 9f0e180
committed
Link shared sanitizer runtime with libresolv for dn_expand
Since the interceptor was added in 1a729bc, a process using
sanitizers might need libresolv for the real version of __dn_expand.
The linker flag for the static runtime was added in 6dce56b.
But the dynamic runtime didn't get the dependency. This can cause
crashes even when libresolv is not used directly, because it is also
used by DNS lookups via e.g. getaddrinfo when the DNS reply uses
compression.
We observed the issue with the address sanitizer, but a quick look into
the shared runtime libraries revealed that the memprof and tsan runtimes
also export dn_expand and should thus be prone to the same issue.
It should be mentioned that glibc plans to move libresolv into libc,
which was partially completed in version 2.34 with the move of dn_comp
and dn_expand. However, that is not an issue here: once the move is
complete, there will only be a static libresolv.a stub left and so
building against a version after the move will no longer produce a
runtime dependency to libresolv.so.
Fixes #59007.1 parent e8c07f7 commit 9f0e180
File tree
4 files changed
+4
-0
lines changed- compiler-rt
- cmake
- lib
- asan
- memprof
- tsan/rtl
4 files changed
+4
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
192 | 193 | | |
193 | 194 | | |
194 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| 156 | + | |
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
0 commit comments