]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/5.0.5/objtool-move-objtool_file-struct-off-the-stack.patch
Linux 5.0.5
[thirdparty/kernel/stable-queue.git] / releases / 5.0.5 / objtool-move-objtool_file-struct-off-the-stack.patch
CommitLineData
3824f72d
GKH
1From 0c671812f152b628bd87c0af49da032cc2a2c319 Mon Sep 17 00:00:00 2001
2From: Josh Poimboeuf <jpoimboe@redhat.com>
3Date: Mon, 18 Mar 2019 19:09:38 -0500
4Subject: objtool: Move objtool_file struct off the stack
5
6From: Josh Poimboeuf <jpoimboe@redhat.com>
7
8commit 0c671812f152b628bd87c0af49da032cc2a2c319 upstream.
9
10Objtool uses over 512k of stack, thanks to the hash table embedded in
11the objtool_file struct. This causes an unnecessarily large stack
12allocation and breaks users with low stack limits.
13
14Move the struct off the stack.
15
16Fixes: 042ba73fe7eb ("objtool: Add several performance improvements")
17Reported-by: Vassili Karpov <moosotc@gmail.com>
18Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
19Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
20Cc: Peter Zijlstra <peterz@infradead.org>
21Cc: stable@vger.kernel.org
22Link: https://lkml.kernel.org/r/df92dcbc4b84b02ffa252f46876df125fb56e2d7.1552954176.git.jpoimboe@redhat.com
23Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
24
25---
26 tools/objtool/check.c | 3 ++-
27 1 file changed, 2 insertions(+), 1 deletion(-)
28
29--- a/tools/objtool/check.c
30+++ b/tools/objtool/check.c
31@@ -2184,9 +2184,10 @@ static void cleanup(struct objtool_file
32 elf_close(file->elf);
33 }
34
35+static struct objtool_file file;
36+
37 int check(const char *_objname, bool orc)
38 {
39- struct objtool_file file;
40 int ret, warnings = 0;
41
42 objname = _objname;