This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH] Remove MAP_DENYWRITE FROM MAP_COPY definition
This one is a cover letter. The patch and its cover are in a single
That's the patch:
I agree about the DSO truncation but MAP_DENYWRITE functionality has
as it effectively allowed anyone with read permissions to block
writing to a file by using mmap
with this flag.
Right now it just pollutes the strace output and confuses people about how DSOs
work (e.g. why cp of a new library over an old one will most likely
result in a segfault
while mv from the same file system will not).
It is hard for me to tell what kind of mechanism would make a better
job in the Linux kernel.
On Sat, Sep 3, 2016 at 9:58 PM, Florian Weimer <firstname.lastname@example.org> wrote:
> * Dmitrii Shcherbakov:
> > Dmitrii Shcherbakov (1):
> > dl-load.h: Remove MAP_DENYWRITE from MAP_COPY definition
> The patch seems to be missing, but I can guess what it looks like.
> I wonder if the kernel can do a better job here. Truncation of DSOs
> is a common source of application crashes because you either get
> SIGBUS immediatelly, or a crash because private writeable mappings are
> cleared. And it's not just about executable mappings, OpenJDK faces
> the same issue with mapped JARs.