| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- From ca358ca3d22248f099a09d65ee25410cf3beebc5 Mon Sep 17 00:00:00 2001
- From: Kamalesh Babulal <[email protected]>
- Date: Sat, 14 Oct 2017 20:17:54 +0530
- Subject: [PATCH 071/231] objtool: Print top level commands on incorrect usage
- MIME-Version: 1.0
- Content-Type: text/plain; charset=UTF-8
- Content-Transfer-Encoding: 8bit
- CVE-2017-5754
- Print top-level objtool commands, along with the error on incorrect
- command line usage. Objtool command line parser exit's with code 129,
- for incorrect usage. Convert the cmd_usage() exit code also, to maintain
- consistency across objtool.
- After the patch:
- $ ./objtool -j
- Unknown option: -j
- usage: objtool COMMAND [ARGS]
- Commands:
- check Perform stack metadata validation on an object file
- orc Generate in-place ORC unwind tables for an object file
- $ echo $?
- 129
- Signed-off-by: Kamalesh Babulal <[email protected]>
- Acked-by: Josh Poimboeuf <[email protected]>
- Cc: Linus Torvalds <[email protected]>
- Cc: Peter Zijlstra <[email protected]>
- Cc: Thomas Gleixner <[email protected]>
- Link: http://lkml.kernel.org/r/[email protected]
- Signed-off-by: Ingo Molnar <[email protected]>
- (cherry picked from commit 6a93bb7e4a7d6670677d5b0eb980936eb9cc5d2e)
- Signed-off-by: Andy Whitcroft <[email protected]>
- Signed-off-by: Kleber Sacilotto de Souza <[email protected]>
- (cherry picked from commit cd75c9c55a5f288e1d3f20c48c5c4c2caf3966e8)
- Signed-off-by: Fabian Grünbichler <[email protected]>
- ---
- tools/objtool/objtool.c | 6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
- diff --git a/tools/objtool/objtool.c b/tools/objtool/objtool.c
- index 31e0f9143840..07f329919828 100644
- --- a/tools/objtool/objtool.c
- +++ b/tools/objtool/objtool.c
- @@ -70,7 +70,7 @@ static void cmd_usage(void)
-
- printf("\n");
-
- - exit(1);
- + exit(129);
- }
-
- static void handle_options(int *argc, const char ***argv)
- @@ -86,9 +86,7 @@ static void handle_options(int *argc, const char ***argv)
- break;
- } else {
- fprintf(stderr, "Unknown option: %s\n", cmd);
- - fprintf(stderr, "\n Usage: %s\n",
- - objtool_usage_string);
- - exit(1);
- + cmd_usage();
- }
-
- (*argv)++;
- --
- 2.14.2
|