OK, thanks. I just wanted to be sure I didn't miss some other reason.
Err, I was double wrong. It _is_ trivial to set ->exe_file before exec_mmap(),
flush_old_exec:
+ get_file(bprm->file);
+ set_mm_exe_file(bprm->mm, bprm->file);
retval = exec_mmap(bprm->mm);
if (retval)
goto mmap_failed;
bprm->mm = NULL; /* We're using it now */
If exec_mmap() fails, the caller (do_execve) has to mmput(bprm->mm)
anyway, and this imply set_mm_exe_file(NULL). This way set_mm_exe_file()
doesn't need any locking.
Not that this is relly important, but still.
However. I didn't notice this patch plays with #ifdef CONFIG_PROC_FS.
Without CONFIG_PROC_FS we seem to leak bprm->file, I'd suggest to move
get_file(bprm->file) into set_mm_exe_file().
Thanks for your answers ;)
Oleg.
--