bug-glibc
[Top][All Lists]
Advanced

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

feature problem ?


From: Josh Fryman
Subject: feature problem ?
Date: Tue, 28 Aug 2001 09:39:20 -0400

hi,

i apologize if this is the wrong place to send this, but i haven't
seen anything better yet.  any redirectors would be appreciated.

i have a weird situation where i need to be able to modify code
as it's running.  [yes, i'm aware of cache-flush issues, etc.
it's not self-modifying per se, it's remote-server-modifying.]

it appears the configuration/design of ld.so won't let me do it.
this is on an ARM target with Linux kernel 2.4.0 with libc-2.1.2.

essentially, i have a client app that contains a (big) dummy
function which is essentially:

void __dummy_func( void )
{
   __asm__("nop");
   __asm__("nop");
   ... etc many times ...
}

this client app opens a socket to the remote server, which begins
feeding chunks of code to the client to overwrite "__dummy_func()"
with.  (using memcpy, pointer assignment, whatever)

the problem is, no matter how i try to do this, __dummy_func() 
can't be replaced.  (a hex-dump verifies this.)  it always shows
the gcc-entry code, my nop's, then the gcc-exit code.  it never
shows what i received from the server.

i'm trying to understand how ld.so sets up the pages of memory 
as it loads my client application.  

is there any way to force it to be Read-Write-Execute on *all* 
the pages for an application?

does linux even pay attention to these settings, or am i chasing
the wrong thing?

if it's possible, should i then just hack up a new ld.so, or are
there some flags i can pass to ld.so to force this?  is there
some trick to enable things like this?  (things like self-modifying
code...)

is there an easier way to do this?

thanks for any input [or pointers to the right place to ask],

josh fryman



reply via email to

[Prev in Thread] Current Thread [Next in Thread]