aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-04 08:19:27 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-04-04 08:19:27 +0200
commita5b5352558f6808db0589644ea5401b3e3148a0d (patch)
tree6d078f73d4fe147d0c04aa2b442c6db4a7a8e079
parent9a904337ad40e1392c1790d84f8cf78fe9226fa4 (diff)
downloadstable-queue-a5b5352558f6808db0589644ea5401b3e3148a0d.tar.gz
3.18-stable patches
added patches: binfmt_elf-switch-to-new-creds-when-switching-to-new-mm.patch
-rw-r--r--queue-3.18/binfmt_elf-switch-to-new-creds-when-switching-to-new-mm.patch57
-rw-r--r--queue-3.18/series1
2 files changed, 58 insertions, 0 deletions
diff --git a/queue-3.18/binfmt_elf-switch-to-new-creds-when-switching-to-new-mm.patch b/queue-3.18/binfmt_elf-switch-to-new-creds-when-switching-to-new-mm.patch
new file mode 100644
index 0000000000..2b7f9ea38b
--- /dev/null
+++ b/queue-3.18/binfmt_elf-switch-to-new-creds-when-switching-to-new-mm.patch
@@ -0,0 +1,57 @@
+From 9f834ec18defc369d73ccf9e87a2790bfa05bf46 Mon Sep 17 00:00:00 2001
+From: Linus Torvalds <torvalds@linux-foundation.org>
+Date: Mon, 22 Aug 2016 16:41:46 -0700
+Subject: binfmt_elf: switch to new creds when switching to new mm
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Linus Torvalds <torvalds@linux-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@swiecki.net>
+Tested-by: Peter Zijlstra <peterz@infradead.org>
+Acked-by: David Howells <dhowells@redhat.com>
+Acked-by: Oleg Nesterov <oleg@redhat.com>
+Acked-by: Andy Lutomirski <luto@amacapital.net>
+Acked-by: Eric 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: Linus Torvalds <torvalds@linux-foundation.org>
+Cc: Federico Manuel Bento <up201407890@fc.up.pt>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/binfmt_elf.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/binfmt_elf.c
++++ b/fs/binfmt_elf.c
+@@ -734,6 +734,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 */
+@@ -935,7 +936,6 @@ static int load_elf_binary(struct linux_
+ goto out;
+ #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)
diff --git a/queue-3.18/series b/queue-3.18/series
index 0958b792ed..83cb0fd0bb 100644
--- a/queue-3.18/series
+++ b/queue-3.18/series
@@ -39,3 +39,4 @@ wlcore-fix-memory-leak-in-case-wl12xx_fetch_firmware.patch
x86-build-mark-per-cpu-symbols-as-absolute-explicitl.patch
dmaengine-tegra-avoid-overflow-of-byte-tracking.patch
drm-dp-mst-configure-no_stop_bit-correctly-for-remot.patch
+binfmt_elf-switch-to-new-creds-when-switching-to-new-mm.patch