[PATCH] Remove MAP_DENYWRITE FROM MAP_COPY definition
Dmitrii Shcherbakov
fw.dmitrii@gmail.com
Sat Sep 3 19:18:00 GMT 2016
Florian,
This one is a cover letter. The patch and its cover are in a single
thread though.
That's the patch:
https://sourceware.org/ml/libc-alpha/2016-09/msg00057.html
I agree about the DSO truncation but MAP_DENYWRITE functionality has
been removed
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 <fw@deneb.enyo.de> 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.
More information about the Libc-alpha
mailing list