LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-25-2005, 03:59 PM   #1
phoenix7
Member
 
Registered: Aug 2004
Distribution: Mandrake 10.2(Mandriva), SuSE 9.3, Slackware 9.1, Xandros 3.1, Knoppix 3.9, FreeBSD 5.3, RedHat9
Posts: 122

Rep: Reputation: 15
process and memory access


Can a process's parent write into its memory (code segment) ?!
 
Old 08-25-2005, 05:34 PM   #2
foo_bar_foo
Senior Member
 
Registered: Jun 2004
Posts: 2,553

Rep: Reputation: 53
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.
 
Old 08-30-2005, 08:49 AM   #3
phoenix7
Member
 
Registered: Aug 2004
Distribution: Mandrake 10.2(Mandriva), SuSE 9.3, Slackware 9.1, Xandros 3.1, Knoppix 3.9, FreeBSD 5.3, RedHat9
Posts: 122

Original Poster
Rep: Reputation: 15
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!
 
Old 08-30-2005, 09:14 AM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941Reputation: 3941
No surprise... you can't do that.
 
Old 08-30-2005, 10:25 AM   #5
phoenix7
Member
 
Registered: Aug 2004
Distribution: Mandrake 10.2(Mandriva), SuSE 9.3, Slackware 9.1, Xandros 3.1, Knoppix 3.9, FreeBSD 5.3, RedHat9
Posts: 122

Original Poster
Rep: Reputation: 15
I can't do what?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to list the process using most memory adoyee Linux - Newbie 3 09-06-2012 03:11 AM
process memory ecampos02 Linux - Newbie 5 11-18-2005 04:42 PM
Help Configuring the Memory Used by a Process in RedHat? (Cache Memory on CPU) geogecko Linux - General 3 02-23-2005 03:32 PM
Maximum Memory PER PROCESS anewsome Linux - General 1 03-08-2004 02:29 PM
RH 8.0 Mapping Virtual Memory to get access to VMIC Reflective Memory PCI card. Merlin53 Linux - Hardware 0 05-05-2003 12:50 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:05 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration