★ wanayoo — archive 1999 http://www.kernelnotes.org/patch/20-p0728.htmlNouvelle recherche | Portail wanayoo

Fork Patch for 2.0.30

Bill Hawes (whawes@star.net)
Mon Aug 4 09:16:00 1997

[Home] [Linux 2.0] [Linux 2.1] [Information] [Software] [Distributions] [Links]

fork_30-patch
> I guess that copy_mm should probably claim the semaphore
> and then null out the copy of it.

After a little more study, it looks like there may be a couple of related problems here -- either the semaphore in use when copied, or the mmap changing while dum_mmap is trying to copy it.

I've attached a preliminary patch that may help -- it cleanly initializes the semaphore, and then acquires the current mmap_sem before calling dup_mmap(). This isn't the best way to do things, but if it help we're probably on the right track.

Another thing I noticed that looks possibly dangerous -- if the memory map includes a mmapped file, the new mm gets added to the inode's shared list. The mm is not yet fully constructed, but is it possible that the new task could be prematurely awakened via the inode shared list? Maybe somebody else here has looked into that ...




[Home] [Up] [Search] [FeedBack]

Copyleft © The LinuxHQ Project. Licensed under the GNU Public License.