summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/sys/syscall_mi.h8
-rw-r--r--sys/uvm/uvm_map.c11
-rw-r--r--sys/uvm/uvm_map.h4
3 files changed, 12 insertions, 11 deletions
diff --git a/sys/sys/syscall_mi.h b/sys/sys/syscall_mi.h
index 48aa8340ea3..3909bb419d7 100644
--- a/sys/sys/syscall_mi.h
+++ b/sys/sys/syscall_mi.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: syscall_mi.h,v 1.20 2019/06/01 22:42:18 deraadt Exp $ */
+/* $OpenBSD: syscall_mi.h,v 1.21 2019/06/14 05:52:42 deraadt Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@@ -68,12 +68,14 @@ mi_syscall(struct proc *p, register_t code, const struct sysent *callp,
#endif
/* SP must be within MAP_STACK space */
- if (!uvm_map_inentry(p, &p->p_spinentry, PROC_STACK(p), "sp",
+ if (!uvm_map_inentry(p, &p->p_spinentry, PROC_STACK(p),
+ "[%s]%d/%d sp=%lx inside %lx-%lx: not MAP_STACK\n",
uvm_map_inentry_sp, p->p_vmspace->vm_map.sserial))
return (EPERM);
/* PC must not be in writeable memory */
- if (!uvm_map_inentry(p, &p->p_pcinentry, PROC_PC(p), "pc",
+ if (!uvm_map_inentry(p, &p->p_pcinentry, PROC_PC(p),
+ "[%s]%d/%d pc=%lx inside %lx-%lx: writeable syscall\n",
uvm_map_inentry_pc, p->p_vmspace->vm_map.wserial))
return (EPERM);
diff --git a/sys/uvm/uvm_map.c b/sys/uvm/uvm_map.c
index af911597a61..bd072c50fb0 100644
--- a/sys/uvm/uvm_map.c
+++ b/sys/uvm/uvm_map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_map.c,v 1.245 2019/06/01 22:42:20 deraadt Exp $ */
+/* $OpenBSD: uvm_map.c,v 1.246 2019/06/14 05:52:43 deraadt Exp $ */
/* $NetBSD: uvm_map.c,v 1.86 2000/11/27 08:40:03 chs Exp $ */
/*
@@ -1860,8 +1860,8 @@ uvm_map_inentry_fix(struct proc *p, struct p_inentry *ie, vaddr_t addr,
}
boolean_t
-uvm_map_inentry(struct proc *p, struct p_inentry *ie, vaddr_t addr, char *name,
- int (*fn)(vm_map_entry_t), u_long serial)
+uvm_map_inentry(struct proc *p, struct p_inentry *ie, vaddr_t addr,
+ const char *fmt, int (*fn)(vm_map_entry_t), u_long serial)
{
union sigval sv;
boolean_t ok = TRUE;
@@ -1870,9 +1870,8 @@ uvm_map_inentry(struct proc *p, struct p_inentry *ie, vaddr_t addr, char *name,
KERNEL_LOCK();
ok = uvm_map_inentry_fix(p, ie, addr, fn, serial);
if (!ok) {
- printf("[%s]%d/%d %s %lx not inside %lx-%lx\n",
- p->p_p->ps_comm, p->p_p->ps_pid, p->p_tid,
- name, addr, ie->ie_start, ie->ie_end);
+ printf(fmt, p->p_p->ps_comm, p->p_p->ps_pid, p->p_tid,
+ addr, ie->ie_start, ie->ie_end);
sv.sival_ptr = (void *)PROC_PC(p);
trapsignal(p, SIGSEGV, 0, SEGV_ACCERR, sv);
}
diff --git a/sys/uvm/uvm_map.h b/sys/uvm/uvm_map.h
index 3ae70bad4a9..8f130b5ee4e 100644
--- a/sys/uvm/uvm_map.h
+++ b/sys/uvm/uvm_map.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_map.h,v 1.61 2019/06/01 22:42:20 deraadt Exp $ */
+/* $OpenBSD: uvm_map.h,v 1.62 2019/06/14 05:52:43 deraadt Exp $ */
/* $NetBSD: uvm_map.h,v 1.24 2001/02/18 21:19:08 chs Exp $ */
/*
@@ -421,7 +421,7 @@ int uvm_map_inentry_pc(vm_map_entry_t);
boolean_t uvm_map_inentry_fix(struct proc *, struct p_inentry *,
vaddr_t addr, int (*fn)(vm_map_entry_t), u_long serial);
boolean_t uvm_map_inentry(struct proc *, struct p_inentry *, vaddr_t addr,
- char *name, int (*fn)(vm_map_entry_t), u_long serial);
+ const char *fmt, int (*fn)(vm_map_entry_t), u_long serial);
struct kinfo_vmentry;