]> git.baikalelectronics.ru Git - 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)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 19 Apr 2015 20:46:21 +0000 (13:46 -0700)
commit7dc74b152feedc2c55c25a89a95bf343c994f6d3
tree99e05c7758aed78cfaf10556cbe7057efaa5c02c
parent9f5e559aa8edc220e542f84a5c8391c8b37ab265
fs: take i_mutex during prepare_binprm for set[ug]id executables

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>
fs/exec.c