summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authormartin <martin@NetBSD.org>2020-03-10 06:47:55 +0000
committermartin <martin@NetBSD.org>2020-03-10 06:47:55 +0000
commitf80251d5f5e654b37b0dbbf15268e813e77c948e (patch)
tree41bd27e5e95c8144acee18573e68c7d45e52a190 /sys/arch/amd64
parent81ec03661b91f32f56783d034ddf4aab1f323a81 (diff)
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 (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/trap.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/trap.c b/sys/arch/amd64/amd64/trap.c
index aa11f3ffbd5..46f77b81970 100644
--- a/sys/arch/amd64/amd64/trap.c
+++ b/sys/arch/amd64/amd64/trap.c
@@ -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 @@ trap(struct trapframe *frame)
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: