-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Implement kernel sanitizers #8435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
HBelusca
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Some questions;
- space fixes for e1000 changes
dea19c4 to
bb280a7
Compare
|
|
||
| ASSERT(pData); | ||
|
|
||
| HandleOverflow(false, pData, ulLHS, ulRHS, PLUS_STRING); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for these being wrappers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
__ubsan_handle_add_overflow/__ubsan_handle_add_overflow_abort/ __ubsan_handle_divrem_overflow/ __ubsan_handle_divrem_overflow_abort/... functions are called by the code generated by the compiler. They all call the same function HandleOverflow.
sdk/lib/ksanitize/ubsan.c
Outdated
| /* | ||
| #include <sys/cdefs.h> | ||
| #if defined(_KERNEL) | ||
| __KERNEL_RCSID(0, "$NetBSD: ubsan.c,v 1.10 2020/03/08 21:35:03 kamil Exp $"); | ||
| #else | ||
| __RCSID("$NetBSD: ubsan.c,v 1.10 2020/03/08 21:35:03 kamil Exp $"); | ||
| #endif | ||
| #if defined(_KERNEL) | ||
| #include <sys/param.h> | ||
| #include <sys/types.h> | ||
| #include <sys/stdarg.h> | ||
| #define ASSERT(x) KASSERT(x) | ||
| #else | ||
| #if defined(_LIBC) | ||
| #include "namespace.h" | ||
| #endif | ||
| #include <sys/param.h> | ||
| #include <assert.h> | ||
| #include <inttypes.h> | ||
| #include <math.h> | ||
| #include <signal.h> | ||
| #include <stdarg.h> | ||
| #include <stdbool.h> | ||
| #include <stdint.h> | ||
| #include <stdio.h> | ||
| #include <stdlib.h> | ||
| #include <string.h> | ||
| #include <syslog.h> | ||
| #include <unistd.h> | ||
| #if defined(_LIBC) | ||
| #include "extern.h" | ||
| #define ubsan_vsyslog vsyslog_ss | ||
| #define ASSERT(x) _DIAGASSERT(x) | ||
| #else | ||
| #define ubsan_vsyslog vsyslog_r | ||
| #define ASSERT(x) assert(x) | ||
| #endif | ||
| */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to keep this? I get that this file is "synced", but how much of it is really still original? Wouldn't it make sense to simply fork it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything is original, except this #ifdef __REACTOS__
58537b7 to
defea0a
Compare
Add SANITIZE_UB switch for enabling -fsanitize=undefined on binaries
defea0a to
7dbc0ed
Compare
Purpose
Implement kernel sanitizers (
-fsanitize=...)This is a resurrection of PR #2527
JIRA issue: CORE-15771
Proposed changes
SANITIZE_UBto enable kernel undefined sanitizersdk/lib/ksanitizehaving required functionsntoskrnl,hal, drivers...) toksanitizelibraryTODO
Testbot runs (Filled in by Devs)