Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 10 Jul 2021 00:48:08 GMT
From:      Mark Johnston <markj@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: f08f0ae5247a - main - amd64: Mark the trapframe as initialized in trap()
Message-ID:  <202107100048.16A0m8L8072307@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj:

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

commit f08f0ae5247ab31de58bda0817e74ccc1a3a5e95
Author:     Mark Johnston <markj@FreeBSD.org>
AuthorDate: 2021-07-10 00:38:03 +0000
Commit:     Mark Johnston <markj@FreeBSD.org>
CommitDate: 2021-07-10 00:38:50 +0000

    amd64: Mark the trapframe as initialized in trap()
    
    Otherwise KASAN may generate false positives if the trapframe was
    written into a poisoned region of the stack.
    
    Reported by:    pho
    Sponsored by:   The FreeBSD Foundation
---
 sys/amd64/amd64/trap.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/amd64/amd64/trap.c b/sys/amd64/amd64/trap.c
index e67e188bb4fd..a60b17cf554f 100644
--- a/sys/amd64/amd64/trap.c
+++ b/sys/amd64/amd64/trap.c
@@ -54,6 +54,7 @@ __FBSDID("$FreeBSD$");
 #include "opt_kdb.h"
 
 #include <sys/param.h>
+#include <sys/asan.h>
 #include <sys/bus.h>
 #include <sys/systm.h>
 #include <sys/proc.h>
@@ -227,6 +228,8 @@ trap(struct trapframe *frame)
 	p = td->td_proc;
 	dr6 = 0;
 
+	kasan_mark(frame, sizeof(*frame), sizeof(*frame), 0);
+
 	VM_CNT_INC(v_trap);
 	type = frame->tf_trapno;
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202107100048.16A0m8L8072307>