summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-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))