aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2021-07-10 00:38:18 +0000
committerMark Johnston <markj@FreeBSD.org>2021-07-10 00:38:50 +0000
commit36226163fa48ee2c5f73bd2e870ce2e5a057f42e (patch)
treeb49d39a9bd025c932d8dc45be9de9e565fadda85
parent5d243d41b1206044cb5eddd5d48c1c711b731478 (diff)
downloadsrc-36226163fa48ee2c5f73bd2e870ce2e5a057f42e.tar.gz
src-36226163fa48ee2c5f73bd2e870ce2e5a057f42e.zip
x86: Mark the trapframe as initialized in ipi_bitmap_handler()
Otherwise KASAN may generate false positives if the trapframe was written into a poisoned region of the stack. Reported by: pho Reported by: syzbot+ee60455cd58e6eed20c9@syzkaller.appspotmail.com Reported by: syzbot+be5f9df26426ace3a00c@syzkaller.appspotmail.com Sponsored by: The FreeBSD Foundation
-rw-r--r--sys/x86/x86/mp_x86.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/x86/x86/mp_x86.c b/sys/x86/x86/mp_x86.c
index 2dcdf923c467..1f22b3a7886a 100644
--- a/sys/x86/x86/mp_x86.c
+++ b/sys/x86/x86/mp_x86.c
@@ -41,6 +41,7 @@ __FBSDID("$FreeBSD$");
#include <sys/param.h>
#include <sys/systm.h>
+#include <sys/asan.h>
#include <sys/bus.h>
#include <sys/cons.h> /* cngetc() */
#include <sys/cpuset.h>
@@ -1279,6 +1280,8 @@ ipi_bitmap_handler(struct trapframe frame)
int cpu = PCPU_GET(cpuid);
u_int ipi_bitmap;
+ kasan_mark(&frame, sizeof(frame), sizeof(frame), 0);
+
td = curthread;
ipi_bitmap = atomic_readandclear_int(&cpuid_to_pcpu[cpu]->
pc_ipi_bitmap);