]>
Commit | Line | Data |
---|---|---|
59d5af67 | 1 | From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 |
321d628a FG |
2 | From: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> |
3 | Date: Sat, 14 Oct 2017 20:17:54 +0530 | |
59d5af67 | 4 | Subject: [PATCH] objtool: Print top level commands on incorrect usage |
321d628a FG |
5 | MIME-Version: 1.0 |
6 | Content-Type: text/plain; charset=UTF-8 | |
7 | Content-Transfer-Encoding: 8bit | |
8 | ||
9 | CVE-2017-5754 | |
10 | ||
11 | Print top-level objtool commands, along with the error on incorrect | |
12 | command line usage. Objtool command line parser exit's with code 129, | |
13 | for incorrect usage. Convert the cmd_usage() exit code also, to maintain | |
14 | consistency across objtool. | |
15 | ||
16 | After the patch: | |
17 | ||
18 | $ ./objtool -j | |
19 | ||
20 | Unknown option: -j | |
21 | ||
22 | usage: objtool COMMAND [ARGS] | |
23 | ||
24 | Commands: | |
25 | check Perform stack metadata validation on an object file | |
26 | orc Generate in-place ORC unwind tables for an object file | |
27 | ||
28 | $ echo $? | |
29 | 129 | |
30 | ||
31 | Signed-off-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com> | |
32 | Acked-by: Josh Poimboeuf <jpoimboe@redhat.com> | |
33 | Cc: Linus Torvalds <torvalds@linux-foundation.org> | |
34 | Cc: Peter Zijlstra <peterz@infradead.org> | |
35 | Cc: Thomas Gleixner <tglx@linutronix.de> | |
36 | Link: http://lkml.kernel.org/r/1507992474-16142-1-git-send-email-kamalesh@linux.vnet.ibm.com | |
37 | Signed-off-by: Ingo Molnar <mingo@kernel.org> | |
38 | (cherry picked from commit 6a93bb7e4a7d6670677d5b0eb980936eb9cc5d2e) | |
39 | Signed-off-by: Andy Whitcroft <apw@canonical.com> | |
40 | Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com> | |
41 | (cherry picked from commit cd75c9c55a5f288e1d3f20c48c5c4c2caf3966e8) | |
42 | Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com> | |
43 | --- | |
44 | tools/objtool/objtool.c | 6 ++---- | |
45 | 1 file changed, 2 insertions(+), 4 deletions(-) | |
46 | ||
47 | diff --git a/tools/objtool/objtool.c b/tools/objtool/objtool.c | |
48 | index 31e0f9143840..07f329919828 100644 | |
49 | --- a/tools/objtool/objtool.c | |
50 | +++ b/tools/objtool/objtool.c | |
51 | @@ -70,7 +70,7 @@ static void cmd_usage(void) | |
52 | ||
53 | printf("\n"); | |
54 | ||
55 | - exit(1); | |
56 | + exit(129); | |
57 | } | |
58 | ||
59 | static void handle_options(int *argc, const char ***argv) | |
60 | @@ -86,9 +86,7 @@ static void handle_options(int *argc, const char ***argv) | |
61 | break; | |
62 | } else { | |
63 | fprintf(stderr, "Unknown option: %s\n", cmd); | |
64 | - fprintf(stderr, "\n Usage: %s\n", | |
65 | - objtool_usage_string); | |
66 | - exit(1); | |
67 | + cmd_usage(); | |
68 | } | |
69 | ||
70 | (*argv)++; | |
71 | -- | |
72 | 2.14.2 | |
73 |