Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F147976120
D29455.1784984974.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D29455.1784984974.diff
View Options
Index: sys/amd64/amd64/machdep.c
===================================================================
--- sys/amd64/amd64/machdep.c
+++ sys/amd64/amd64/machdep.c
@@ -58,6 +58,7 @@
#include <sys/param.h>
#include <sys/proc.h>
#include <sys/systm.h>
+#include <sys/asan.h>
#include <sys/bio.h>
#include <sys/buf.h>
#include <sys/bus.h>
@@ -1930,6 +1931,8 @@
#endif
thread0.td_critnest = 0;
+ kasan_init();
+
TSEXIT();
/* Location of kernel stack for locore */
Index: sys/amd64/conf/GENERIC-KASAN
===================================================================
--- /dev/null
+++ sys/amd64/conf/GENERIC-KASAN
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+include GENERIC
+
+ident GENERIC-KASAN
+
+options KASAN
Index: sys/amd64/conf/GENERIC-KMSAN
===================================================================
--- /dev/null
+++ sys/amd64/conf/GENERIC-KMSAN
@@ -0,0 +1,7 @@
+# $FreeBSD$
+
+include GENERIC
+
+ident GENERIC-KMSAN
+
+options KMSAN
Index: sys/amd64/include/param.h
===================================================================
--- sys/amd64/include/param.h
+++ sys/amd64/include/param.h
@@ -134,8 +134,12 @@
#define IOPERM_BITMAP_SIZE (IOPAGES * PAGE_SIZE + 1)
#ifndef KSTACK_PAGES
+#ifdef KASAN
+#define KSTACK_PAGES 6
+#else
#define KSTACK_PAGES 4 /* pages of kstack (with pcb) */
#endif
+#endif
#define KSTACK_GUARD_PAGES 1 /* pages of kstack guard; 0 disables */
/*
Index: sys/x86/isa/atpic.c
===================================================================
--- sys/x86/isa/atpic.c
+++ sys/x86/isa/atpic.c
@@ -37,6 +37,7 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/asan.h>
#include <sys/bus.h>
#include <sys/interrupt.h>
#include <sys/kernel.h>
@@ -522,6 +523,9 @@
{
struct intsrc *isrc;
+ /* The frame may have been written into a poisoned region. */
+ kasan_mark(frame, sizeof(*frame), sizeof(*frame), 0);
+
KASSERT(vector < NUM_ISA_IRQS, ("unknown int %u\n", vector));
isrc = &atintrs[vector].at_intsrc;
Index: sys/x86/x86/local_apic.c
===================================================================
--- sys/x86/x86/local_apic.c
+++ sys/x86/x86/local_apic.c
@@ -43,6 +43,7 @@
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/asan.h>
#include <sys/bus.h>
#include <sys/kernel.h>
#include <sys/lock.h>
@@ -1299,6 +1300,9 @@
{
struct intsrc *isrc;
+ /* The frame may have been written into a poisoned region. */
+ kasan_mark(frame, sizeof(*frame), sizeof(*frame), 0);
+
isrc = intr_lookup_source(apic_idt_to_irq(PCPU_GET(apic_id),
vector));
intr_execute_handlers(isrc, frame);
@@ -1314,6 +1318,9 @@
/* Send EOI first thing. */
lapic_eoi();
+ /* The frame may have been written into a poisoned region. */
+ kasan_mark(frame, sizeof(*frame), sizeof(*frame), 0);
+
#if defined(SMP) && !defined(SCHED_ULE)
/*
* Don't do any accounting for the disabled HTT cores, since it
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Jul 25, 1:09 PM (57 m, 13 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29255907
Default Alt Text
D29455.1784984974.diff (2 KB)
Attached To
Mode
D29455: amd64: Add MD bits for KASAN
Attached
Detach File
Event Timeline
Log In to Comment