LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   process and memory access (https://www.linuxquestions.org/questions/linux-software-2/process-and-memory-access-356980/)

phoenix7 08-25-2005 03:59 PM

process and memory access
 
Can a process's parent write into its memory (code segment) ?!

foo_bar_foo 08-25-2005 05:34 PM

well i think generally the parents memory all becomes copy on write and both the parent and child get copies if they try to write.
might be different if you create child with clone() ?
you can always share memory either thru shared memory or mmap but not executable code section i don't think. I mean really does any process have write access to it's code ?
accept for the fact that all linux segments are overlapping and all start at the same place.
isn't all code segments either execute only or execute/read.

phoenix7 08-30-2005 08:49 AM

My question is can I fork a process and call exec then change codesegment of the child process?
If I can do this, I can do this scenario on a program with root's suid such as passwd then run my own program with root's permission! :D

sundialsvcs 08-30-2005 09:14 AM

No surprise... you can't do that.

phoenix7 08-30-2005 10:25 AM

I can't do what?


All times are GMT -5. The time now is 03:33 AM.