Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern Rollback unintended changes in the previous commit
details: https://anonhg.NetBSD.org/src/rev/b1d773dee874
branches: trunk
changeset: 945046:b1d773dee874
user: kamil <kamil%NetBSD.org@localhost>
date: Mon Oct 19 14:52:19 2020 +0000
description:
Rollback unintended changes in the previous commit
diffstat:
sys/kern/sys_ptrace.c | 29 ++++++++++++++++++++++++++---
sys/kern/sys_ptrace_common.c | 28 +++++++++++++++++++++++++---
2 files changed, 51 insertions(+), 6 deletions(-)
diffs (109 lines):
diff -r c7c5d2377624 -r b1d773dee874 sys/kern/sys_ptrace.c
--- a/sys/kern/sys_ptrace.c Mon Oct 19 14:47:01 2020 +0000
+++ b/sys/kern/sys_ptrace.c Mon Oct 19 14:52:19 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sys_ptrace.c,v 1.7 2020/10/19 14:47:01 kamil Exp $ */
+/* $NetBSD: sys_ptrace.c,v 1.8 2020/10/19 14:52:19 kamil Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -106,9 +106,8 @@
* from: @(#)sys_process.c 8.1 (Berkeley) 6/10/93
*/
-
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace.c,v 1.7 2020/10/19 14:47:01 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace.c,v 1.8 2020/10/19 14:52:19 kamil Exp $");
#ifdef _KERNEL_OPT
#include "opt_ptrace.h"
@@ -129,6 +128,7 @@
#include <sys/syscallargs.h>
#include <sys/syscallvar.h>
#include <sys/syscall.h>
+#include <sys/module.h>
#include <uvm/uvm_extern.h>
@@ -214,3 +214,26 @@
return do_ptrace(&native_ptm, l, SCARG(uap, req), SCARG(uap, pid),
SCARG(uap, addr), SCARG(uap, data), retval);
}
+
+#define DEPS "ptrace_common"
+
+MODULE(MODULE_CLASS_EXEC, ptrace, DEPS);
+
+static int
+ptrace_modcmd(modcmd_t cmd, void *arg)
+{
+ int error;
+
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+ error = syscall_establish(&emul_netbsd, ptrace_syscalls);
+ break;
+ case MODULE_CMD_FINI:
+ error = syscall_disestablish(&emul_netbsd, ptrace_syscalls);
+ break;
+ default:
+ error = ENOTTY;
+ break;
+ }
+ return error;
+}
diff -r c7c5d2377624 -r b1d773dee874 sys/kern/sys_ptrace_common.c
--- a/sys/kern/sys_ptrace_common.c Mon Oct 19 14:47:01 2020 +0000
+++ b/sys/kern/sys_ptrace_common.c Mon Oct 19 14:52:19 2020 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sys_ptrace_common.c,v 1.85 2020/10/19 14:47:01 kamil Exp $ */
+/* $NetBSD: sys_ptrace_common.c,v 1.86 2020/10/19 14:52:19 kamil Exp $ */
/*-
* Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -106,9 +106,8 @@
* from: @(#)sys_process.c 8.1 (Berkeley) 6/10/93
*/
-
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.85 2020/10/19 14:47:01 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_ptrace_common.c,v 1.86 2020/10/19 14:52:19 kamil Exp $");
#ifdef _KERNEL_OPT
#include "opt_ptrace.h"
@@ -135,6 +134,7 @@
#include <sys/kauth.h>
#include <sys/mount.h>
#include <sys/syscallargs.h>
+#include <sys/module.h>
#include <sys/condvar.h>
#include <sys/mutex.h>
#include <sys/compat_stub.h>
@@ -1785,3 +1785,25 @@
return 0;
}
#endif /* PTRACE */
+
+MODULE(MODULE_CLASS_EXEC, ptrace_common, NULL);
+
+static int
+ptrace_common_modcmd(modcmd_t cmd, void *arg)
+{
+ int error;
+
+ switch (cmd) {
+ case MODULE_CMD_INIT:
+ error = ptrace_init();
+ break;
+ case MODULE_CMD_FINI:
+ error = ptrace_fini();
+ break;
+ default:
+ ptrace_hooks();
+ error = ENOTTY;
+ break;
+ }
+ return error;
+}
Home |
Main Index |
Thread Index |
Old Index