Commit Graph

3 Commits

Author SHA1 Message Date
Daniel Bertalan
653d22e21f LibSanitizer+AK: Add float cast overflow handler
This is not enabled by default in GCC, but is in Clang.
2021-08-08 10:55:36 +02:00
Andrew Kaster
882002c566 LibSantizer: Read $UBSAN_OPTIONS to set deadliness on first print
The first time we want to print a UBSAN violation, the UBSAN runtime
in userspace will get the UBSAN_OPTIONS environment variable to check if
it contains the string "halt_on_error=1". This is clearly not robust to
invalid options or adding more options, but it gets the job done at the
moment. :^)
2021-06-29 07:17:34 +04:30
Andrew Kaster
4a5a1e8648 Userland: Port UBSAN implementation to userspace
Take Kernel/UBSanitizer.cpp and make a copy in LibSanitizer.

We can use LibSanitizer to hold other sanitizers as people implement
them :^).

To enable UBSAN for LibC, DynamicLoader, and other low level system
libraries, LibUBSanitizer is built as a serenity_libc, and has a static
version for LibCStatic to use. The approach is the same as that taken in

Note that this means now UBSAN is enabled for code generators, Lagom,
Kernel, and Userspace with -DENABLE_UNDEFINED_SANTIZER=ON. In userspace
however, UBSAN is not deadly (yet).

Co-authored-by: ForLoveOfCats <ForLoveOfCats@vivaldi.net>
2021-05-27 15:18:03 +02:00