Commit 9f834ec1 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

binfmt_elf: switch to new creds when switching to new mm

We used to delay switching to the new credentials until after we had
mapped the executable (and possible elf interpreter).  That was kind of
odd to begin with, since the new executable will actually then _run_
with the new creds, but whatever.

The bigger problem was that we also want to make sure that we turn off
prof events and tracing before we start mapping the new executable
state.  So while this is a cleanup, it's also a fix for a possible
information leak.
Reported-by: default avatarRobert Święcki <>
Tested-by: default avatarPeter Zijlstra <>
Acked-by: default avatarDavid Howells <>
Acked-by: default avatarOleg Nesterov <>
Acked-by: default avatarAndy Lutomirski <>
Acked-by: default avatarEric W. Biederman <>
Cc: Willy Tarreau <>
Cc: Kees Cook <>
Cc: Al Viro <>
Signed-off-by: default avatarLinus Torvalds <>
parent 61b5ebd6
......@@ -853,6 +853,7 @@ static int load_elf_binary(struct linux_binprm *bprm)
current->flags |= PF_RANDOMIZE;
/* Do this so that we can load the interpreter, if need be. We will
change some of these later */
......@@ -1044,7 +1045,6 @@ static int load_elf_binary(struct linux_binprm *bprm)
goto out;
retval = create_elf_tables(bprm, &loc->elf_ex,
load_addr, interp_load_addr);
if (retval < 0)
Markdown is supported
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