git: 36226163fa48 - main - x86: Mark the trapframe as initialized in ipi_bitmap_handler()

Mark Johnston markj at FreeBSD.org
Sat Jul 10 00:48:11 UTC 2021


The branch main has been updated by markj:

URL: https://cgit.FreeBSD.org/src/commit/?id=36226163fa48ee2c5f73bd2e870ce2e5a057f42e

commit 36226163fa48ee2c5f73bd2e870ce2e5a057f42e
Author:     Mark Johnston <markj at FreeBSD.org>
AuthorDate: 2021-07-10 00:38:18 +0000
Commit:     Mark Johnston <markj at FreeBSD.org>
CommitDate: 2021-07-10 00:38:50 +0000

    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 at syzkaller.appspotmail.com
    Reported by:    syzbot+be5f9df26426ace3a00c at syzkaller.appspotmail.com
    Sponsored by:   The FreeBSD Foundation
---
 sys/x86/x86/mp_x86.c | 3 +++
 1 file changed, 3 insertions(+)

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);


More information about the dev-commits-src-all mailing list