Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/amd64/amd64 Don't even try to go past a syscall. Fi...



details:   https://anonhg.NetBSD.org/src/rev/8e1fbc92ac99
branches:  trunk
changeset: 972048:8e1fbc92ac99
user:      maxv <maxv%NetBSD.org@localhost>
date:      Thu May 14 16:57:53 2020 +0000

description:
Don't even try to go past a syscall. Fixes severe panic recursions in
KUBSAN.

diffstat:

 sys/arch/amd64/amd64/db_machdep.c |  17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diffs (48 lines):

diff -r 7f47460ef3d6 -r 8e1fbc92ac99 sys/arch/amd64/amd64/db_machdep.c
--- a/sys/arch/amd64/amd64/db_machdep.c Thu May 14 16:32:57 2020 +0000
+++ b/sys/arch/amd64/amd64/db_machdep.c Thu May 14 16:57:53 2020 +0000
@@ -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 @@
                *arg0 = (long *)&fp->f_arg0;
                break;
 
+           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 SYSCALL:
            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;



Home | Main Index | Thread Index | Old Index