Mark Kettenis <[email protected]> writes: > 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?
I'm not an uvm hacker but your explanation and the diff make sense to me. Successfuly tested on i386. We should really get coredumps fixed before g2k16. :) > > 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; > > -- jca | PGP: 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE
