Skip to content
Commit dcc54a54 authored by Bernd Edlinger's avatar Bernd Edlinger Committed by Greg Kroah-Hartman
Browse files

exec: Fix error handling in begin_new_exec()

commit 84c39ec5 upstream.

If get_unused_fd_flags() fails, the error handling is incomplete because
bprm->cred is already set to NULL, and therefore free_bprm will not
unlock the cred_guard_mutex. Note there are two error conditions which
end up here, one before and one after bprm->cred is cleared.

Fixes: b8a61c9e

 ("exec: Generic execfd support")
Signed-off-by: default avatarBernd Edlinger <bernd.edlinger@hotmail.de>
Acked-by: default avatarEric W. Biederman <ebiederm@xmission.com>
Link: https://lore.kernel.org/r/AS8P193MB128517ADB5EFF29E04389EDAE4752@AS8P193MB1285.EURP193.PROD.OUTLOOK.COM


Cc: stable@vger.kernel.org
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 46464457
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment