Re: [PATCH] include all vmas with unbacked pages in ELF core dumps

From: Roland McGrath
Date: Thu Oct 21 2004 - 17:22:27 EST


>
>
> On Thu, 21 Oct 2004, Hugh Dickins wrote:
> >
> > if (!vma->anon_vma)
> > return 0;
>
> Ok. So the end result ends up pretty simple:
>
> static int maydump(struct vm_area_struct *vma)
> {
> /* Do not dump I/O mapped devices, shared memory, or special mappings */
> if (vma->vm_flags & (VM_IO | VM_SHARED | VM_RESERVED))
> return 0;
>
> /* If it hasn't been written to, don't write it out */
> if (!vma->anon_vma)
> return 0;
>
> return 1;
> }
>
> does this make everybody happy?

I expect that has the same result as my patch (which tested vma->vm_file
instead of vma->vm_flags & VM_SHARED). It produces the same good results
on the simple tests I've done (for glibc's RELRO segments).


Thanks,
Roland
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/