[PATCH] Re: READ-ONLY mmap not present in core

From: Pavel Krauz
Date: Tue Oct 21 2003 - 08:44:47 EST


> I have verified that the READ_ONLY mmap mapping of file did not propagate
> to core file.

Here goes a patch that solves the problem. The READ_ONLY - only mappings are now included to the core file. The executable regions are still excluded. The size of core
did not change a lot and you have all important info in core and don't get
unreferencable pointers inside a debugger.

Please apply to 2.4.X and 2.6.X also
Pavel


with patch (emacs, netscape, xemacs):
4706304 core.all.emacs
9129984 core.all.netscape
5726208 core.all.xemacs

without patch:
4452352 core.emacs
8851456 core.netscape
5459968 core.xemacs


--- linux/fs/binfmt_elf.c.bak Tue Oct 21 15:21:13 2003
+++ linux/fs/binfmt_elf.c Tue Oct 21 15:21:18 2003
@@ -952,7 +952,7 @@
#if 1
if (vma->vm_flags & (VM_WRITE|VM_GROWSUP|VM_GROWSDOWN))
return 1;
- if (vma->vm_flags & (VM_READ|VM_EXEC|VM_EXECUTABLE|VM_SHARED))
+ if (vma->vm_flags & (VM_EXEC|VM_EXECUTABLE))
return 0;
#endif
return 1;




____________________________________________________________
Mall [mo:l] - promenáda, široká alej, nákupní středisko (velké)
Internet Mall - profesionální nákupní galerie na Internetu (http://www.mall.cz)
-
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/