Re: /proc/<pid>/mem unreadable

Alan Cox (alan@cymru.net)
Wed, 8 May 1996 09:49:51 +0100 (BST)


> The best solution is, I believe, to validate the request at
> read-time instead of open-time.

Be very careful that you don't do

if(request_valid(x))
{
memcpy_tofs(....)

as the paging of the process could sleep and cause the data to be copied
from the new task I think. It might need

if(request_valid(x))
{
memcpy_tofs(....)
if(!request_valid(x))
memset(..,0,...)

}

Alan