aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2021-07-10 00:38:18 +0000
committerMark Johnston <markj@FreeBSD.org>2021-11-01 14:06:57 +0000
commit281ad195bd42fa2dbb503c7b55b9108615e83d79 (patch)
treeb3d28a3ac1a61669a875ebbc5f21b519f87b7946
parent7e85d20eb8f16f8892fda4924a601655220216ca (diff)
downloadsrc-281ad195bd42fa2dbb503c7b55b9108615e83d79.tar.gz
src-281ad195bd42fa2dbb503c7b55b9108615e83d79.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 (cherry picked from commit 36226163fa48ee2c5f73bd2e870ce2e5a057f42e)
-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 255a6c13f025..ca1125886619 100644
--- a/sys/x86/x86/mp_x86.c
+++ b/sys/x86/x86/mp_x86.c
@@ -42,6 +42,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>
@@ -1282,6 +1283,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);