From 77a2d6cbf8f9757281d2942cf4a433f5cd9cbc62 Mon Sep 17 00:00:00 2001 From: pgoyette Date: Fri, 20 Nov 2015 01:21:05 +0000 Subject: [PATCH] Don't allow setting the PID-to-trace if the target has a non-native emulation. --- sys/dev/filemon/filemon.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/filemon/filemon.c b/sys/dev/filemon/filemon.c index 6d8ef55c4f3a..022d854a623d 100644 --- a/sys/dev/filemon/filemon.c +++ b/sys/dev/filemon/filemon.c @@ -24,7 +24,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: filemon.c,v 1.12 2015/11/20 01:12:38 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: filemon.c,v 1.13 2015/11/20 01:21:05 pgoyette Exp $"); #include #include @@ -308,7 +308,8 @@ filemon_ioctl(struct file * fp, u_long cmd, void *data) mutex_enter(proc_lock); tp = proc_find(*((pid_t *) data)); mutex_exit(proc_lock); - if (tp == NULL) { + if (tp == NULL || + tp->p_emul != &emul_netbsd)) { error = ESRCH; break; }