<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/110215>110215</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
SHA2 ASAN interceptors on FreeBSD and NetBSD
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
botovq
</td>
</tr>
</table>
<pre>
The SHA2 `*_{Init,Update,Final,Transform}()` functions on FreeBSD ([manual][1]) and NetBSD (cf [manual][2]) collide with functions of the same name [in OpenSSL][3]. The signatures are incompatible (return types and contexts).
This leads to undesirable runtime failures when using `-fsanitize=-address` in combination with `-lcrypto`.
Not all of the below are problematic for both FreeBSD and NetBSD, but should probably be audited in detail and potentially be removed.
https://github.com/llvm/llvm-project/blob/880ee48d5c9d88be1c611451e84f16eafcebd1a6/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h#L564-L570
See https://github.com/libressl/portable/issues/1098, https://github.com/openssl/openssl/issues/25456, and https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281685 for more details.
Cc: @krytarowski @devnexen
[1]: https://man.freebsd.org/cgi/man.cgi?query=SHA256_Init&apropos=0&sektion=0&manpath=FreeBSD+14.1-RELEASE+and+Ports&arch=default&format=html
[2]: https://man.netbsd.org/SHA256_Init.3
[3]: https://docs.openssl.org/3.0/man3/SHA256_Init/
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVU-P46gT_TSVC4plg-3YBx-S9li_n9SaXW1mzy0w5ZhtDB7Ancl8-hVJupO0dkfaiwlQ9Xiv_oV7rw4GsYFiB0W74ksYrWuEDfbt-0pYeWq-jUj2_9tSAmUKdPsCm93_jQpAn_6cJQ8I9KlThmugT98cN36wboJNC7QCWkOZkmExfVDWeGIN6Rzibt-SeF3sJm4WrqFoodhlcaE14UaSrxiuRv1APtnRq11vtVYSyVGF8f6NgYQRiecTEhM_U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