]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - 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
1 From 0c671812f152b628bd87c0af49da032cc2a2c319 Mon Sep 17 00:00:00 2001
2 From: Josh Poimboeuf <jpoimboe@redhat.com>
3 Date: Mon, 18 Mar 2019 19:09:38 -0500
4 Subject: objtool: Move objtool_file struct off the stack
5
6 From: Josh Poimboeuf <jpoimboe@redhat.com>
7
8 commit 0c671812f152b628bd87c0af49da032cc2a2c319 upstream.
9
10 Objtool uses over 512k of stack, thanks to the hash table embedded in
11 the objtool_file struct. This causes an unnecessarily large stack
12 allocation and breaks users with low stack limits.
13
14 Move the struct off the stack.
15
16 Fixes: 042ba73fe7eb ("objtool: Add several performance improvements")
17 Reported-by: Vassili Karpov <moosotc@gmail.com>
18 Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
19 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
20 Cc: Peter Zijlstra <peterz@infradead.org>
21 Cc: stable@vger.kernel.org
22 Link: https://lkml.kernel.org/r/df92dcbc4b84b02ffa252f46876df125fb56e2d7.1552954176.git.jpoimboe@redhat.com
23 Signed-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;