lkml.org 
[lkml]   [2003]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] dump read-only anonymous memory in core files

What about shared mappings (that test should be VM_MAYSHARE)?

My inclination would be to not dump them if they are backed by a file,
even if the mmap is writable.

Also, the VM_WRITE test should possibly be VM_MAYWRITE, since the thing
could have been mprotect()'ed. Alternatively, we could really add a "this
mapping has been writable" flag (a kind of "sticky VM_WRITE" bit). It's
only mprotect that can do this, anyway.

Ehh?

Which would make the logic be something like

/* Do not dump I/O mapped devices! -DaveM */
if (vma->vm_flags & VM_IO)
return 0;

/* file-backed mapping? */
if (vma->vm_file) {
if (vma->vm_flags & VM_MAYSHARE)
return 0;
if (!(vma->vm_flags & VM_MAYWRITE))
return 0;
}

return 1;

Hmm?

Linus

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

\
 
 \ /
  Last update: 2009-11-18 23:46    [W:0.050 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site