KUBSAN(4)
π NAME π
kubsan β kernel undefined behavior sanitizer. And yes bestie, this is kubsan(4) from the Kernel Interfaces Manual β group-chat approved, terminal-ready π
β¨
πΈ SYNOPSIS πΈ
option KUBSAN
π¦ DESCRIPTION π¦
okay so kubsan detects undefined behavior at runtime inside the kernel π₯ Detected undefined behavior gets printed to the system console, including the offending line in the source code β so you can literally see where the chaos happened π
By default, kubsan is not enabled, but instead requires the following line to be present in the kernel configuration:
option KUBSAN
The following undefined behavior is detected:
- Float cast overflow β the conversion from a floating point to an integer cannot be represented by the destination type π
- Integer overflow β the result of an arithmetic computation on two integer operands cannot be represented by the destination type.
- Negate overflow β negation of an integer cannot be represented by the destination type.
- Pointer overflow β pointer arithmetic overflow.
- Out of bounds β array indexing out of bounds, limited to cases where the size of the array can be statically determined π
- Shift out of bounds β undefined logical shift caused by:
- The shift amount being negative.
- The shift operand being negative.
- The shift amount exceeds the number of bits as given by the shift operand type.
- The result of the shift computation cannot be represented by the destination type.
- Non-null argument β passing
NULLas the value for a function argument annotated with__nonnull__π - Invalid builtin β passing zero to a compiler builtin where not allowed.
- Invalid load β loading a value that cannot be represented by the destination type.
- Type mismatch β mismatch between pointer and value type caused by:
- A pointer which does not fulfill the alignment requirements of the value type.
- A pointer to an address which lacks sufficient space to store the value type.
- Unreachable β execution reached passed a function annotated with
__deadπ
π SEE ALSO π
options(4)β go read that too, bestie π«Ά
π HISTORY π
The kubsan implementation is derived from NetBSD and first appeared in OpenBSD 6.5. iconic behavior, no cap β¨
π AUTHORS π
The kubsan implementation was written by Anton Lindqvist <anton@openbsd.org> π«Ά
β CAVEATS β
The kubsan implementation is limited to architectures using clang(1) as their default compiler. that's the vibe check, fr fr π
Debian edition, dated September 6, 2024 β that's the footer tea bestie, slay and stay safe out there π«Άπ
π¦ where this page comes from
- nixpkgs unstable: cvs-export
- Copyright (c) 2019 Anton Lindqvist <anton@openbsd.org>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms