Kernel related (?) user space crash at ARM11 MPCore

Catalin Marinas catalin.marinas at arm.com
Tue Sep 22 04:43:12 EDT 2009


On Mon, 2009-09-21 at 23:25 +0100, Jamie Lokier wrote:
> 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.

So the code above would use MAP_SHARED here to make the files visible to
to other processes.

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

That's in a different application I suspect.

I think my scenario previously described could be valid but source code
analysis is needed to be sure. If pages in the kernel page cache have
dirty cache lines, update_mmu_cache() may only invalidate the I-cache
rather than cleaning the D-cache.

If this scenario is valid, we may need to implement flush_cache_range()
or flush_cache_page().

-- 
Catalin




More information about the linux-arm-kernel mailing list