From: Jann Horn Date: Sun, 19 Apr 2015 00:48:39 +0000 (+0200) Subject: fs: take i_mutex during prepare_binprm for set[ug]id executables X-Git-Tag: v3.2.69~42 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=470e517be17dd6ef8670bec7bd7831ea0d3ad8a6;p=pandora-kernel.git fs: take i_mutex during prepare_binprm for set[ug]id executables commit 8b01fc86b9f425899f8a3a8fc1c47d73c2c20543 upstream. This prevents a race between chown() and execve(), where chowning a setuid-user binary to root would momentarily make the binary setuid root. This patch was mostly written by Linus Torvalds. Signed-off-by: Jann Horn Signed-off-by: Linus Torvalds [bwh: Backported to 3.2: - Drop the task_no_new_privs() and user namespace checks - Open-code file_inode() - s/READ_ONCE/ACCESS_ONCE/ - Adjust context] Signed-off-by: Ben Hutchings --- Reading git-diff-tree failed