Re: + fix-procfs-task-exe-symlink.patch added to -mm tree

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Matt Helsley <matthltc@...>
Cc: <akpm@...>, <linux-kernel@...>, <dhowells@...>, <ebiederm@...>, <hch@...>, <viro@...>
Date: Tuesday, January 29, 2008 - 7:36 am

s/mm-commits/lkml/

On 01/28, Matt Helsley wrote:

OK, thanks. This leads to another question which I forgot to ask.

This patch has a lot of complications because it tries to preserve the
current behaviour: we release the bprm->file when all VM_EXECTUABLE vmas
are unmapped. Q: is this so important/useful? I don't think this is very
common case, and I don't quite understand why it is critical to release
the file. To unmount fs after starting the app? One can always copy
the file before execing, or do "/lib/ld-linus.so application" and then
unmap the vmas.

(I am not arguing, just curious).


Well, we only need down_read(mmap_sem) for the very short time. /proc/pid/maps
is much "worse" in this sense.


Sorry, I was wrong.

mmput() has to release ->exe_file if it is called when exec fails before the
first do_mmmap(MAP_EXECUTABLE). This also means that it is not completely
trivial to set ->exe_file before exec_mmap(), it can fail. This is solvable,
but I'm not sure we should do this.

Still, the accounting looks a little bit fragile to me. flush_old_exec()
increments ->f_count but sets ->num_exe_file_vmas = 0 because we know that
the next elf_map() will bump ->num_exe_file_vmas and thus "sync" 2 counters.
But I don't see how to do better if we really want to release the file when
VM_EXECUTABLE disappears.

Oleg.

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: + fix-procfs-task-exe-symlink.patch added to -mm tree, Oleg Nesterov, (Tue Jan 29, 7:36 am)
Re: + fix-procfs-task-exe-symlink.patch added to -mm tree, Oleg Nesterov, (Wed Jan 30, 7:06 am)