Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147911735
D29454.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
956 B
Referenced Files
None
Subscribers
None
D29454.diff
View Options
diff --git a/sys/conf/kern.pre.mk b/sys/conf/kern.pre.mk
--- a/sys/conf/kern.pre.mk
+++ b/sys/conf/kern.pre.mk
@@ -92,6 +92,16 @@
# XXX LOCORE means "don't declare C stuff" not "for locore.s".
ASM_CFLAGS= -x assembler-with-cpp -DLOCORE ${CFLAGS} ${ASM_CFLAGS.${.IMPSRC:T}}
+KASAN_ENABLED!= grep KASAN opt_global.h || true ; echo
+.if !empty(KASAN_ENABLED)
+SAN_CFLAGS+= -fsanitize=kernel-address \
+ -mllvm -asan-stack=true \
+ -mllvm -asan-instrument-dynamic-allocas=true \
+ -mllvm -asan-globals=true \
+ -mllvm -asan-use-after-scope=true \
+ -mllvm -asan-instrumentation-with-call-threshold=0
+.endif
+
KCSAN_ENABLED!= grep KCSAN opt_global.h || true ; echo
.if !empty(KCSAN_ENABLED)
SAN_CFLAGS+= -fsanitize=thread
diff --git a/sys/conf/options b/sys/conf/options
--- a/sys/conf/options
+++ b/sys/conf/options
@@ -229,6 +229,7 @@
# Sanitizers
COVERAGE opt_global.h
+KASAN opt_global.h
KCOV
KCSAN opt_global.h
KUBSAN opt_global.h
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Mar 15, 2:58 PM (1 h, 9 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29720418
Default Alt Text
D29454.diff (956 B)
Attached To
Mode
D29454: Add a KASAN option to the kernel build
Attached
Detach File
Event Timeline
Log In to Comment