From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752965AbdHKMTW (ORCPT ); Fri, 11 Aug 2017 08:19:22 -0400 Received: from terminus.zytor.com ([65.50.211.136]:41573 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752823AbdHKMTV (ORCPT ); Fri, 11 Aug 2017 08:19:21 -0400 Date: Fri, 11 Aug 2017 05:13:32 -0700 From: tip-bot for Josh Poimboeuf Message-ID: Cc: arnd@arndb.de, mingo@kernel.org, bp@alien8.de, linux-kernel@vger.kernel.org, hpa@zytor.com, torvalds@linux-foundation.org, brgerst@gmail.com, dvlasenk@redhat.com, jpoimboe@redhat.com, tglx@linutronix.de, luto@kernel.org, peterz@infradead.org Reply-To: bp@alien8.de, arnd@arndb.de, mingo@kernel.org, dvlasenk@redhat.com, jpoimboe@redhat.com, tglx@linutronix.de, luto@kernel.org, peterz@infradead.org, linux-kernel@vger.kernel.org, hpa@zytor.com, torvalds@linux-foundation.org, brgerst@gmail.com In-Reply-To: References: To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/asm] objtool: Fix validate_branch() return codes Git-Commit-ID: 12b25729a194198e3c4289adaddc4115b10b094e X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 12b25729a194198e3c4289adaddc4115b10b094e Gitweb: http://git.kernel.org/tip/12b25729a194198e3c4289adaddc4115b10b094e Author: Josh Poimboeuf AuthorDate: Thu, 10 Aug 2017 16:37:25 -0500 Committer: Ingo Molnar CommitDate: Fri, 11 Aug 2017 14:06:14 +0200 objtool: Fix validate_branch() return codes The validate_branch() function should never return a negative value. Errors are treated as warnings so that even if something goes wrong, objtool does its best to generate ORC data for the rest of the file. Signed-off-by: Josh Poimboeuf Cc: Andy Lutomirski Cc: Arnd Bergmann Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Fixes: baa41469a7b9 ("objtool: Implement stack validation 2.0") Link: http://lkml.kernel.org/r/d86671cfde823b50477cd2f6f548dfe54871e24d.1502401017.git.jpoimboe@redhat.com Signed-off-by: Ingo Molnar --- tools/objtool/check.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 4f0c4ae..5814e90 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -1524,7 +1524,7 @@ static int validate_branch(struct objtool_file *file, struct instruction *first, if (insn->alt_group && list_empty(&insn->alts)) { WARN_FUNC("don't know how to handle branch to middle of alternative instruction group", sec, insn->offset); - return -1; + return 1; } while (1) { @@ -1543,7 +1543,7 @@ static int validate_branch(struct objtool_file *file, struct instruction *first, if (func && insn->ignore) { WARN_FUNC("BUG: why am I validating an ignored function?", sec, insn->offset); - return -1; + return 1; } if (insn->visited) { @@ -1681,7 +1681,7 @@ static int validate_branch(struct objtool_file *file, struct instruction *first, case INSN_STACK: if (update_insn_state(insn, &state)) - return -1; + return 1; break;