linux/fs/exec.c
Jann Horn 7f1a6ae73b fs: take i_mutex during prepare_binprm for set[ug]id executables
[ Upstream commit 8b01fc86b9 ]

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: Sasha Levin <sasha.levin@oracle.com>
2015-05-17 19:12:32 -04:00

1638 lines
38 KiB