Kernel related (?) user space crash at ARM11 MPCore

Catalin Marinas catalin.marinas at arm.com
Mon Sep 21 04:49:04 EDT 2009


On Mon, 2009-09-21 at 09:31 +0100, Jamie Lokier wrote:
> I'm not able to tell from this thread, and I don't have the hardware
> to test either:
> 
> I have some userspace ARM code which modifies instructions and data
> used by those instructions in a few pages, using mprotect() to make
> them writable, modify, and make them PROT_READ|PROT_EXEC again.

As Russell said, we have system call dedicated to flushing the caches if
you write instructions. Now it's arguable whether using mprotect(RX)
should also flush the cache.

> I expect the behaviour is the same as that toolchain which modifies
> instructions in the ELF PLT.  (Which, by the way, an ARM FDPIC-ELF
> for no-MMU I've been working on also does).

In this thread, the dynamic linker only writes data. The CoW mechanism
has the side-effect of incoherent I-D caches.

-- 
Catalin




More information about the linux-arm-kernel mailing list