tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Tests requiring MD hooks

On Mon, 11 Jul 2011 19:46:33 +0400, Valeriy E. Ushakov wrote:
But you do cast your mapped address to a function pointer.  Does that
do the right thing for architectures with fat function pointers?

Untested; will see this evening what the resulting code does.

You also don't seem to mention instruction/data-cache issues. I don't remember if mprotecting something +x makes any guarantees about caches
(cf. arm_sync_icache(2) for example).

OG does say a thing about this. I assume that mprotect(2) should flush them (especially icache upon removal of --x right), and count this as a bug if it does not.

Best way to see is through testing, although I see a couple of icache_sync in ARM pmap each time execute mappings are modified.

I can't do that simply through rtld, as I need to memcpy(2) the payload
and therefore have access to the beginning (which is not necessarily
trivial given certain architectures), and the end (never found a way to
properly label those without using assembly routines).

You can always parse ELF yourself (unfortunately libelf is still not
imported, it seems).

That's a possibility, yes. Although this would restrict me to ELF, and rule out all other binary formats.

Jean-Yves Migeon

Home | Main Index | Thread Index | Old Index