The branch main has been updated by markj:

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

commit f08f0ae5247ab31de58bda0817e74ccc1a3a5e95
Author:     Mark Johnston <[email protected]>
AuthorDate: 2021-07-10 00:38:03 +0000
Commit:     Mark Johnston <[email protected]>
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;
 
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to