[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1556377989.761854587@decadent.org.uk>
Date: Sat, 27 Apr 2019 16:13:09 +0100
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org, Denis Kirjanov <kda@...ux-powerpc.org>,
"Eric W. Biederman" <ebiederm@...ssion.com>,
"Willy Tarreau" <w@....eu>, "Oleg Nesterov" <oleg@...hat.com>,
"Robert Święcki" <robert@...ecki.net>,
"Peter Zijlstra" <peterz@...radead.org>,
"Al Viro" <viro@...iv.linux.org.uk>,
"Kees Cook" <keescook@...omium.org>,
"David Howells" <dhowells@...hat.com>,
"Andy Lutomirski" <luto@...capital.net>,
"Linus Torvalds" <torvalds@...ux-foundation.org>
Subject: [PATCH 3.16 200/202] binfmt_elf: switch to new creds when
switching to new mm
3.16.66-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Linus Torvalds <torvalds@...ux-foundation.org>
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: Robert Święcki <robert@...ecki.net>
Tested-by: Peter Zijlstra <peterz@...radead.org>
Acked-by: David Howells <dhowells@...hat.com>
Acked-by: Oleg Nesterov <oleg@...hat.com>
Acked-by: Andy Lutomirski <luto@...capital.net>
Acked-by: Eric W. Biederman <ebiederm@...ssion.com>
Cc: Willy Tarreau <w@....eu>
Cc: Kees Cook <keescook@...omium.org>
Cc: Al Viro <viro@...iv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@...ux-foundation.org>
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
fs/binfmt_elf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -736,6 +736,7 @@ static int load_elf_binary(struct linux_
current->flags |= PF_RANDOMIZE;
setup_new_exec(bprm);
+ install_exec_creds(bprm);
/* Do this so that we can load the interpreter, if need be. We will
change some of these later */
@@ -951,7 +952,6 @@ static int load_elf_binary(struct linux_
}
#endif /* ARCH_HAS_SETUP_ADDITIONAL_PAGES */
- install_exec_creds(bprm);
retval = create_elf_tables(bprm, &loc->elf_ex,
load_addr, interp_load_addr);
if (retval < 0) {
Powered by blists - more mailing lists