summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2017-02-02 06:23:58 +0000
committerguenther <guenther@openbsd.org>2017-02-02 06:23:58 +0000
commit13ca7240452ba02d7e16122b776f7eca2c876d46 (patch)
tree3868b79c1ce94a1bc3abb53398c15868bd4cf033
parentcopy the mbox into the dcmd struct, not the pointer to the mbox. (diff)
downloadwireguard-openbsd-13ca7240452ba02d7e16122b776f7eca2c876d46.tar.xz
wireguard-openbsd-13ca7240452ba02d7e16122b776f7eca2c876d46.zip
When dumping core, skip pages marked as unreadable instead of aborting
the dump. tracked down with help from semarie@ ok mpi@
-rw-r--r--sys/uvm/uvm_unix.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sys/uvm/uvm_unix.c b/sys/uvm/uvm_unix.c
index de36ab95788..001d91bf13e 100644
--- a/sys/uvm/uvm_unix.c
+++ b/sys/uvm/uvm_unix.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_unix.c,v 1.60 2016/09/16 01:09:53 dlg Exp $ */
+/* $OpenBSD: uvm_unix.c,v 1.61 2017/02/02 06:23:58 guenther Exp $ */
/* $NetBSD: uvm_unix.c,v 1.18 2000/09/13 15:00:25 thorpej Exp $ */
/*
@@ -165,6 +165,16 @@ uvm_coredump_walkmap(struct proc *p, void *iocookie,
entry->start != p->p_p->ps_sigcode)
continue;
+ /*
+ * Skip pages marked as unreadable, as uiomove(UIO_USERSPACE)
+ * will fail on them. Maybe this really should be a test of
+ * entry->max_protection, but doing
+ * uvm_map_extract(UVM_EXTRACT_FIXPROT)
+ * when dumping such a mapping would suck.
+ */
+ if ((entry->protection & PROT_READ) == 0)
+ continue;
+
/* Don't dump mmaped devices. */
if (entry->object.uvm_obj != NULL &&
UVM_OBJ_IS_DEVICE(entry->object.uvm_obj))