Don't allow setting the PID-to-trace if the target has a non-native

emulation.
This commit is contained in:
pgoyette 2015-11-20 01:21:05 +00:00
parent e019cfbdd6
commit 77a2d6cbf8

View File

@ -24,7 +24,7 @@
*/
#include <sys/cdefs.h>
__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 <sys/param.h>
#include <sys/kernel.h>
@ -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;
}