From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752586AbcLFKNe (ORCPT ); Tue, 6 Dec 2016 05:13:34 -0500 Received: from terminus.zytor.com ([198.137.202.10]:46010 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751335AbcLFKNb (ORCPT ); Tue, 6 Dec 2016 05:13:31 -0500 Date: Tue, 6 Dec 2016 02:10:48 -0800 From: tip-bot for Jiri Slaby Message-ID: Cc: luto@kernel.org, jslaby@suse.cz, peterz@infradead.org, jpoimboe@redhat.com, mingo@kernel.org, tglx@linutronix.de, brgerst@gmail.com, hpa@zytor.com, dvlasenk@redhat.com, torvalds@linux-foundation.org, bp@alien8.de, linux-kernel@vger.kernel.org Reply-To: mingo@kernel.org, peterz@infradead.org, jpoimboe@redhat.com, tglx@linutronix.de, brgerst@gmail.com, luto@kernel.org, jslaby@suse.cz, linux-kernel@vger.kernel.org, bp@alien8.de, hpa@zytor.com, dvlasenk@redhat.com, torvalds@linux-foundation.org In-Reply-To: <20161205105551.25917-1-jslaby@suse.cz> References: <20161205105551.25917-1-jslaby@suse.cz> To: linux-tip-commits@vger.kernel.org Subject: [tip:core/urgent] objtool: Fix bytes check of lea's rex_prefix Git-Commit-ID: 69042bf2001b44e81cd86ab11a4637b9d9a14c5a 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: 69042bf2001b44e81cd86ab11a4637b9d9a14c5a Gitweb: http://git.kernel.org/tip/69042bf2001b44e81cd86ab11a4637b9d9a14c5a Author: Jiri Slaby AuthorDate: Mon, 5 Dec 2016 11:55:51 +0100 Committer: Ingo Molnar CommitDate: Tue, 6 Dec 2016 09:20:59 +0100 objtool: Fix bytes check of lea's rex_prefix For the "lea %(rsp), %rbp" case, we check if there is a rex_prefix. But we check 'bytes' which is insn_byte_t[4] in rex_prefix (insn_field structure). Therefore, the check is always true. Instead, check 'nbytes' which is the right one. Signed-off-by: Jiri Slaby Acked-by: Josh Poimboeuf Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/20161205105551.25917-1-jslaby@suse.cz Signed-off-by: Ingo Molnar --- tools/objtool/arch/x86/decode.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c index b63a31b..5e0dea2 100644 --- a/tools/objtool/arch/x86/decode.c +++ b/tools/objtool/arch/x86/decode.c @@ -99,7 +99,7 @@ int arch_decode_instruction(struct elf *elf, struct section *sec, break; case 0x8d: - if (insn.rex_prefix.bytes && + if (insn.rex_prefix.nbytes && insn.rex_prefix.bytes[0] == 0x48 && insn.modrm.nbytes && insn.modrm.bytes[0] == 0x2c && insn.sib.nbytes && insn.sib.bytes[0] == 0x24)