Commit graph

9 commits

Author SHA1 Message Date
Andrew Kaster 505f84daae Kernel+AK: Move UBSanitizer to AK, and to AK namespace
In preparation for copying UBSanitizer to userspace, move the header to
AK :^)
2021-05-27 15:18:03 +02:00
Brian Gianforcaro 1682f0b760 Everything: Move to SPDX license identifiers in all files.
SPDX License Identifiers are a more compact / standardized
way of representing file license information.

See: https://spdx.dev/resources/use/#identifiers

This was done with the `ambr` search and replace tool.

 ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-04-22 11:22:27 +02:00
Ben Wiederhake 00131d244e Kernel: Expose sysctl 'ubsan_is_deadly' to panic the Kernel on UB
This makes it easier to find UB, for example when fuzzing the Kernel.

This can be enabled by default, thanks to @boricj's work in
32e1354b9b.
2021-03-07 17:31:25 +01:00
Hendiadyoin1 4d5496b2b2
KUBSAN: Add nearly all missing -fsanitize handlers (#5254) 2021-02-11 20:58:01 +01:00
Brian Gianforcaro c95d48c8d6 Kernel: KUBSAN implementation of returns-nonnull-attribute
This didn't find anything in the current source.
2021-02-07 10:22:03 +01:00
Andreas Kling 04ff46bff4 Kernel: And some more KUBSAN checks :^)
Here comes a few more:

* enum
* object-size
* vptr
2021-02-06 17:39:49 +01:00
Andreas Kling fad0332898 Kernel: Implement some more KUBSAN checks :^)
This patch enables the following -fsanitize sub-options:

* bounds
* bounds-strict
* integer-divide-by-zero
* return
* shift
* shift-base
* shift-exponent
2021-02-06 17:39:49 +01:00
Andreas Kling d164f89ada Kenrel: Implement two more KUBSAN checks
This patch adds the following UndefinedBehaviorSanitizer sub-options:

* signed-integer-overflow
* vla-bound
2021-02-05 21:23:11 +01:00
Andreas Kling d44be96893 Kernel: KUBSAN! (Kernel Undefined Behavior SANitizer) :^)
We now build the kernel with partial UBSAN support.
The following -fsanitize sub-options are enabled:

* nonnull-attribute
* bool

If the kernel detects UB at runtime, it will now print a debug message
with a stack trace. This is very cool! I'm leaving it on by default for
now, but we'll probably have to re-evaluate this as more options are
enabled and slowdown increases.
2021-02-05 21:23:11 +01:00