From: Oleg Nesterov Date: Wed, 11 Sep 2013 21:24:41 +0000 (-0700) Subject: exec: move allow_write_access/fput to exec_binprm() X-Git-Tag: v3.12-rc1~52^2~73 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52f14282bb0c3d3e5ba2a9eaacb12ff37a033e7e;p=pandora-kernel.git exec: move allow_write_access/fput to exec_binprm() When search_binary_handler() succeeds it does allow_write_access() and fput(), then it clears bprm->file to ensure the caller will not do the same. We can simply move this code to exec_binprm() which is called only once. In fact we could move this to free_bprm() and remove the same code in do_execve_common's error path. Signed-off-by: Oleg Nesterov Acked-by: Kees Cook Cc: Al Viro Cc: Evgeniy Polyakov Cc: Zach Levis Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed