Subject: Kernel related (?) user space crash at ARM11 MPCore

From: [email-masked] (Jamie Lokier)
Date: Mon, 21 Sep 2009 23:25:47 +0100

Russell King - ARM Linux wrote:
> > Hopefully it's clear that munmap of the region, followed by mmap
> > PROT_READ|PROTE_EXEC to restore the mapping with different permissions
> > (when it has a backing file) - hopefully it's clear that _that_ will
> > do the needed I-cache flush.
> 
> Not necessarily, especially if the file is mapped using MAP_PRIVATE.

If the answer is not necessarily for MAP_SHARED, then we're in trouble
when someone does

    internal_untar("some_files.tar.gz");

        -> Uses open/ftruncate/mmap(PROT_WRITE)/close to write the files.

    dlopen("some_files/code.so")
    code(...)

Which strikes as the sort of thing people might do these days.

For MAP_PRIVATE...  I'm not sure if that will trip people up or not.

-- Jamie