]> git.ipfire.org Git - people/arne_f/kernel.git/commit
fs: take i_mutex during prepare_binprm for set[ug]id executables
authorJann Horn <jann@thejh.net>
Sun, 19 Apr 2015 00:48:39 +0000 (02:48 +0200)
committerJiri Slaby <jslaby@suse.cz>
Fri, 15 May 2015 07:10:41 +0000 (09:10 +0200)
commit5176b77f1aacdc560eaeac4685ade444bb814689
tree66ecf6514c6be58b50976bc1d59711ba47a1b0b9
parent91350acb28a60304636f9a8d6f739e0b2e99ef10
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 <jann@thejh.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Charles Williams <ciwillia@brocade.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
fs/exec.c