kernel: add ubsan bindings, fix some UB reported by it

This commit is contained in:
Matheus
2024-12-31 11:20:27 -03:00
parent 4ee5fa42ae
commit 6245a3d19f
11 changed files with 348 additions and 90 deletions
+1 -1
View File
@@ -30,7 +30,7 @@ static int maxseek(int minor, size_t *max) {
static long current = 0xdeadbeefbadc0ffe;
static uint8_t getrand8() {
__attribute__((no_sanitize("undefined"))) static uint8_t getrand8() {
current += timekeeper_timefromboot().ns * timekeeper_timefromboot().s - timekeeper_time().ns * timekeeper_time().s + timekeeper_time().s;
return current & 0xff;
}