Commit e6835065 authored by Linus Torvalds's avatar Linus Torvalds Committed by DidntRead
Browse files

binfmt_elf: switch to new creds when switching to new mm



commit 9f834ec18defc369d73ccf9e87a2790bfa05bf46 upstream.

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 <robert@swiecki.net>
Tested-by: default avatarPeter Zijlstra <peterz@infradead.org>
Acked-by: default avatarDavid Howells <dhowells@redhat.com>
Acked-by: default avatarOleg Nesterov <oleg@redhat.com>
Acked-by: default avatarAndy Lutomirski <luto@amacapital.net>
Acked-by: default avatarEric W. Biederman <ebiederm@xmission.com>
Cc: Willy Tarreau <w@1wt.eu>
Cc: Kees Cook <keescook@chromium.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
Cc: Federico Manuel Bento <up201407890@fc.up.pt>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fc4075e8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment