Re: How to open files a process has mmapped

Alan Cox (alan@lxorguk.ukuu.org.uk)
Sat, 6 Apr 2002 18:50:39 +0100 (BST)


> a file a process has mmap-ed. The trouble is that the file might be
> deleted (this is actually likely in this scenario) so I can't just open
> the file listed in /proc/<pid>/maps.

Well perhaps they should not have deleted it

> I have looked some at this, and I haven't come up with a good solution
> for this. I have come up with the following solutions:

You forgot fix the program to do sensible things. You can pass file handles
over AF_UNIX sockets for example, or you could rename the file so you can
find it then delete it later

> The last solution I could think of was to provide a way to open a file
> with using the major/minor/inode (since these are listed for the mapped
> files in the /proc/<pid>/maps file). This is kind of ugly, but it's
> probably the best one I've thought of.

Nice way to do security holes
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/