Re: More problems in dup_mmap

Alan Cox (alan@lxorguk.ukuu.org.uk)
Thu, 7 Aug 1997 01:11:52 +0100 (BST)


> I was thinking last night when I was driving home -- things like
> verify_area examine the mm, and this can be happening concurrently
> with other functions manipulating it. It seems that reader/writer

The kernel isnt itself running on multiple CPU's at once or being pre-empted
so there should only be one case which can cause at worst an "Oops" killing
a process safely (consider the following case..

mmap somefile
clone CLONE_VM
1. ftruncate somefile
2. write(fd,somefile_mmap, len)

)

> addressed in the 2.1.x series of kernels. I'm not convinced
> that the level of upheaval is worth it in 2.0.3x

Look at the 2.1.x copy_from_user/copy_to_user exception handling. Except
on the 386 it resolves the issue. Theres a small 386 patch to clone needed
to disallow CLONE_VM on a 386.