With relro, certain bits of a process that were mapped into memory as
writable are revreted back to read-only after making some initial
changes. Since the kernel coredump code only writes out writable
pieces of memory, these relro bits are not written out. Unfortunately
these bits contain essential pieces of information that the debugger
needs to analyze the coredump.
The diff below fixes that bu also dumping out all the bits that have
an amap allocated. That's a sign that the pages are no longer
pristine and have been written to.
ok?
Index: uvm_unix.c
===================================================================
RCS file: /home/cvs/src/sys/uvm/uvm_unix.c,v
retrieving revision 1.58
diff -u -p -r1.58 uvm_unix.c
--- uvm_unix.c 4 Apr 2016 16:34:16 -0000 1.58
+++ uvm_unix.c 12 Aug 2016 21:45:22 -0000
@@ -161,6 +161,7 @@ uvm_coredump_walkmap(struct proc *p, voi
}
if (!(entry->protection & PROT_WRITE) &&
+ entry->aref.ar_amap == NULL &&
entry->start != p->p_p->ps_sigcode)
continue;