summaryrefslogtreecommitdiff
path: root/Kernel/UBSanitizer.cpp
AgeCommit message (Collapse)Author
2021-10-14Kernel: Add per platform Processor.h headersJames Mintram
The platform independent Processor.h file includes the shared processor code and includes the specific platform header file. All references to the Arch/x86/Processor.h file have been replaced with a reference to Arch/Processor.h.
2021-06-24Kernel: Pull apart CPU.hHendiadyoin1
This does not add any functional changes
2021-05-27Kernel+AK: Move UBSanitizer to AK, and to AK namespaceAndrew Kaster
In preparation for copying UBSanitizer to userspace, move the header to AK :^)
2021-05-19Kernel: static vs non-static constexpr variablesLenny Maiorani
Problem: - `static` variables consume memory and sometimes are less optimizable. - `static const` variables can be `constexpr`, usually. - `static` function-local variables require an initialization check every time the function is run. Solution: - If a global `static` variable is only used in a single function then move it into the function and make it non-`static` and `constexpr`. - Make all global `static` variables `constexpr` instead of `const`. - Change function-local `static const[expr]` variables to be just `constexpr`.
2021-05-15Kernel: Halt CPU on deadly UBSAN instead of calling PANICBrian Gianforcaro
The separate backtrace that the PANIC emits isn't useful and just adds more data to visually filter from the output when debugging an issue. Instead of calling PANIC, just emit the message with dbgln() and manually halt the system.
2021-05-02Kernel: Remove outdated UBSan commentsHendiadyoin1
The triple-fault issue has long been fixed
2021-04-29Kernel: Enable building the kernel with -fltoGunnar Beutner
GCC with -flto is more aggressive when it comes to inlining and discarding functions which is why we must mark some of the functions as NEVER_INLINE (because they contain asm labels which would be duplicated in the object files if the compiler decides to inline the function elsewhere) and __attribute__((used)) for others so that GCC doesn't discard them.
2021-04-25Everywhere: Remove empty line after function body opening curly braceLinus Groh
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
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-18Everywhere: Fix a bunch of typosLinus Groh
2021-03-07Kernel: Expose sysctl 'ubsan_is_deadly' to panic the Kernel on UBBen Wiederhake
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 32e1354b9b0050dd2920c8506cef2841789e14df.
2021-02-24Kernel: Improve KUBSAN logging for "type mismatch" errorsAndreas Kling
Parse out some more information about the error from the data we get.
2021-02-11KUBSAN: Add nearly all missing -fsanitize handlers (#5254)Hendiadyoin1
2021-02-07Kernel: KUBSAN implementation of returns-nonnull-attributeBrian Gianforcaro
This didn't find anything in the current source.
2021-02-06Kernel: And some more KUBSAN checks :^)Andreas Kling
Here comes a few more: * enum * object-size * vptr
2021-02-06Kernel: Implement some more KUBSAN checks :^)Andreas Kling
This patch enables the following -fsanitize sub-options: * bounds * bounds-strict * integer-divide-by-zero * return * shift * shift-base * shift-exponent
2021-02-05Kenrel: Implement two more KUBSAN checksAndreas Kling
This patch adds the following UndefinedBehaviorSanitizer sub-options: * signed-integer-overflow * vla-bound
2021-02-05Kernel: KUBSAN! (Kernel Undefined Behavior SANitizer) :^)Andreas Kling
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.