Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SHA2 ASAN interceptors on FreeBSD and NetBSD #110215

Closed
botovq opened this issue Sep 27, 2024 · 1 comment · Fixed by #110246
Closed

SHA2 ASAN interceptors on FreeBSD and NetBSD #110215

botovq opened this issue Sep 27, 2024 · 1 comment · Fixed by #110246

Comments

@botovq
Copy link

botovq commented Sep 27, 2024

The SHA2 *_{Init,Update,Final,Transform}() functions on FreeBSD (manual) and NetBSD (cf manual) collide with functions of the same name in OpenSSL. 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.

#define SANITIZER_INTERCEPT_SHA1 SI_NETBSD
#define SANITIZER_INTERCEPT_MD4 SI_NETBSD
#define SANITIZER_INTERCEPT_RMD160 SI_NETBSD
#define SANITIZER_INTERCEPT_MD5 (SI_NETBSD || SI_FREEBSD)
#define SANITIZER_INTERCEPT_FSEEK (SI_NETBSD || SI_FREEBSD)
#define SANITIZER_INTERCEPT_MD2 SI_NETBSD
#define SANITIZER_INTERCEPT_SHA2 (SI_NETBSD || SI_FREEBSD)

See libressl/portable#1098, openssl/openssl#25456, and https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=281685 for more details.

Cc: @krytarowski @devnexen

@devnexen
Copy link
Member

devnexen commented Oct 9, 2024

Will make a PR backport to 19.x later in the day.

@EugeneZelenko EugeneZelenko added compiler-rt:sanitizer and removed compiler-rt:asan Address sanitizer labels Oct 9, 2024
devnexen added a commit to devnexen/llvm-project that referenced this issue Oct 9, 2024
llvmbot pushed a commit to llvmbot/llvm-project that referenced this issue Oct 11, 2024
)

To Fix llvm#110215

Interceptors introduced with 18a7ebd

(cherry picked from commit d0b9c2c)
tru pushed a commit to llvmbot/llvm-project that referenced this issue Oct 15, 2024
)

To Fix llvm#110215

Interceptors introduced with 18a7ebd

(cherry picked from commit d0b9c2c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants