Source-Changes-HG archive

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

[src/netbsd-9]: src/sys Pull up following revision(s) (requested by pgoyette ...



details:   https://anonhg.NetBSD.org/src/rev/c969470fedcc
branches:  netbsd-9
changeset: 745742:c969470fedcc
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Mar 10 06:47:55 2020 +0000

description:
Pull up following revision(s) (requested by pgoyette in ticket #778):

        sys/compat/netbsd32/netbsd32_mod.c: revision 1.20
        sys/arch/amd64/amd64/trap.c: revision 1.127

Rework previous, so that the real syscall code is not invoked from within
the module_hook code.  Otherwise, if the syscall just happens to be exit()
we will exit while still holding a reference to the hook's localcount, and
nothing will ever release that reference.  Attempts to manually unload the
module will hang indefinitely, as will modstat(8).

XXX pullup-9

diffstat:

 sys/arch/amd64/amd64/trap.c        |  9 ++++++---
 sys/compat/netbsd32/netbsd32_mod.c |  7 ++-----
 2 files changed, 8 insertions(+), 8 deletions(-)

diffs (59 lines):

diff -r 60d690c03d85 -r c969470fedcc sys/arch/amd64/amd64/trap.c
--- a/sys/arch/amd64/amd64/trap.c       Mon Mar 09 18:51:35 2020 +0000
+++ b/sys/arch/amd64/amd64/trap.c       Tue Mar 10 06:47:55 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: trap.c,v 1.121.2.2 2020/03/09 13:12:14 martin Exp $    */
+/*     $NetBSD: trap.c,v 1.121.2.3 2020/03/10 06:47:55 martin Exp $    */
 
 /*
  * Copyright (c) 1998, 2000, 2017 The NetBSD Foundation, Inc.
@@ -64,7 +64,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.121.2.2 2020/03/09 13:12:14 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: trap.c,v 1.121.2.3 2020/03/10 06:47:55 martin Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -356,8 +356,11 @@
 
                MODULE_HOOK_CALL(amd64_oosyscall_hook, (p, frame),
                        ENOSYS, hook_ret);
-               if (hook_ret == 0)
+               if (hook_ret == 0) {
+                       /* Do the syscall */
+                       p->p_md.md_syscall(frame);
                        goto out;
+               }
        }
                /* FALLTHROUGH */
        case T_TSSFLT|T_USER:
diff -r 60d690c03d85 -r c969470fedcc sys/compat/netbsd32/netbsd32_mod.c
--- a/sys/compat/netbsd32/netbsd32_mod.c        Mon Mar 09 18:51:35 2020 +0000
+++ b/sys/compat/netbsd32/netbsd32_mod.c        Tue Mar 10 06:47:55 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_mod.c,v 1.15.4.3 2020/03/09 09:55:52 martin Exp $     */
+/*     $NetBSD: netbsd32_mod.c,v 1.15.4.4 2020/03/10 06:47:55 martin Exp $     */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -59,7 +59,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_mod.c,v 1.15.4.3 2020/03/09 09:55:52 martin Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_mod.c,v 1.15.4.4 2020/03/10 06:47:55 martin Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_execfmt.h"
@@ -151,9 +151,6 @@
                /* Advance past the lcall and save instruction size. */
                frame->tf_rip += sz;
                frame->tf_err = sz;
-
-               /* Do the syscall */
-               p->p_md.md_syscall(frame);
                return 0;
        } else
                return EPASSTHROUGH;



Home | Main Index | Thread Index | Old Index