pidfd: Use new infrastructure to fix deadlocks in execve
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Sat, 21 Mar 2020 02:46:16 +0000 (02:46 +0000)
committerEric W. Biederman <ebiederm@xmission.com>
Wed, 25 Mar 2020 15:04:01 +0000 (10:04 -0500)
commit501f9328bf5c6b5e4863da4b50e0e86792de3aa9
tree1daa6f09d76a01c93cb59372e85e017a833ca5c9
parent6914303824bb572278568330d72fc1f8f9814e67
pidfd: Use new infrastructure to fix deadlocks in execve

This changes __pidfd_fget to use the new exec_update_mutex
instead of cred_guard_mutex.

This should be safe, as the credentials do not change
before exec_update_mutex is locked.  Therefore whatever
file access is possible with holding the cred_guard_mutex
here is also possbile with the exec_update_mutex.

Signed-off-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
kernel/pid.c