4 Commits

Author SHA1 Message Date
Travis Geiselbrecht
ac6468c916 [ubsan] fix some warnings on 32bit arches
Mostly from the use of ssize_t which does not play well with printf and
32bit arches on LK for underlying type reasons that haven't really ever
been sorted out properly.
2025-10-05 14:43:13 -07:00
Pedro Falcato
ca633e2cb2 [ubsan] Improve printing of value in shift_out_of_bounds
Print it according to the type information we're given.
2023-02-18 23:13:23 -08:00
Pedro Falcato
36fd884faa [ubsan] Fix minor copy-paste bugs
Two handlers accidentally had the wrong prototype, called the wrong
thing and/or had the wrong name.

Should only affect divrem_overflow_abort, negate_overflow_abort.
2023-02-18 23:13:23 -08:00
Pedro Falcato
8ebbcea5ed [ubsan] Add UBSAN implementation
Add an UBSAN implementation and a new UBSAN switch to the make build.
The implementation is taken from Onyx and handles most of the cases
that should be needed for a kernel build. Floating point and fancy
C++ CFI features are not supported yet.

To build with UBSAN, pass UBSAN=1 to make such as:
PROJECT=pc-x86-64-test make -jN UBSAN=1
2023-02-18 16:47:16 -08:00