Module Name: src
Committed By: maxv
Date: Thu May 14 16:57:53 UTC 2020
Modified Files:
src/sys/arch/amd64/amd64: db_machdep.c
Log Message:
Don't even try to go past a syscall. Fixes severe panic recursions in
KUBSAN.
To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/amd64/amd64/db_machdep.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/amd64/amd64/db_machdep.c
diff -u src/sys/arch/amd64/amd64/db_machdep.c:1.6 src/sys/arch/amd64/amd64/db_machdep.c:1.7
--- src/sys/arch/amd64/amd64/db_machdep.c:1.6 Fri Mar 16 08:48:34 2018
+++ src/sys/arch/amd64/amd64/db_machdep.c Thu May 14 16:57:53 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: db_machdep.c,v 1.6 2018/03/16 08:48:34 maxv Exp $ */
+/* $NetBSD: db_machdep.c,v 1.7 2020/05/14 16:57:53 maxv Exp $ */
/*
* Mach Operating System
@@ -26,7 +26,7 @@
* rights to redistribute these changes.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.6 2018/03/16 08:48:34 maxv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: db_machdep.c,v 1.7 2020/05/14 16:57:53 maxv Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -125,22 +125,23 @@ db_nextframe(long **nextframe, long **re
*arg0 = (long *)&fp->f_arg0;
break;
- case TRAP:
case SYSCALL:
+ tf = (struct trapframe *)argp;
+ (*pr)("--- syscall (number %"DDB_EXPR_FMT"u) ---\n",
+ db_get_value((long)&tf->tf_rax, 8, false));
+ return 0;
+
+ case TRAP:
case INTERRUPT:
default:
- /* The only argument to trap() or syscall() is the trapframe. */
+ /* The only argument to trap() is the trapframe. */
tf = (struct trapframe *)argp;
switch (is_trap) {
case TRAP:
(*pr)("--- trap (number %"DDB_EXPR_FMT"u) ---\n",
db_get_value((long)&tf->tf_trapno, 8, false));
break;
- case SYSCALL:
- (*pr)("--- syscall (number %"DDB_EXPR_FMT"u) ---\n",
- db_get_value((long)&tf->tf_rax, 8, false));
- break;
case INTERRUPT:
(*pr)("--- interrupt ---\n");
break;