Messages in this thread | | | Date | Mon, 5 Mar 2012 18:46:48 +0400 | From | Cyrill Gorcunov <> | Subject | Re: [RFC] c/r: prctl: Add ability to set new mm_struct::exe_file |
| |
On Mon, Mar 05, 2012 at 03:26:55PM +0100, Oleg Nesterov wrote: > > OK, I won't argue, probably this makes sense to make sure that > > admin can't get a heart attack looking at /proc/pid/exe. > > > > But the O_RDONLY check looks strange. We are not going to write > > to this file, we only set the name (and that is why I think it > > should be mm->exe_path). What is the point to check that the file > > was opened without FMODE_WRITE? Even if there were any security > > risk the apllication can open this file again with the different > > flags. >
Hi Oleg!
Replying to both your email -- I wanted to be as close to open_exec as possible. This prctl does cheat the kernel but with this tests the cheating should be minimized (it's almost the same as open_exec does).
> Seriously, I think we should cleanup this before c/r adds more > ugliness. I'll try to make the patch today. >
Cleanup what? If you mean this patch -- just point me what should I do.
> And with all these checks I am no longer sure that fd is better > than filename ;)
This security tests was a reason why I've used open_exec in first version of the patch (and I still would prefer to have open_exec here instead of fd).
As to allow-write-access -- it should be cleaned once process finished, no?
Cyrill
| |