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: Wednesday, January 30, 2008 - 7:06 am

On 01/29, Matt Helsley wrote:

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.

--
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)