diff options
author | Philip Guenther <guenther@cvs.openbsd.org> | 2017-02-02 06:23:59 +0000 |
---|---|---|
committer | Philip Guenther <guenther@cvs.openbsd.org> | 2017-02-02 06:23:59 +0000 |
commit | d70dbd1ed85d76a7cc2945bab79b5d8b3c4f9efb (patch) | |
tree | 0835f81a734ac0ba49bbed70af194298975dcf34 /sys | |
parent | ad63cd4159e72b4a5451f9d6d333ebf1fc6b3283 (diff) |
When dumping core, skip pages marked as unreadable instead of aborting
the dump.
tracked down with help from semarie@
ok mpi@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/uvm/uvm_unix.c | 12 |
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)) |