linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] objtool: fix bytes check of lea's rex_prefix
@ 2016-12-05 10:55 Jiri Slaby
  2016-12-05 20:24 ` Josh Poimboeuf
  2016-12-06 10:10 ` [tip:core/urgent] objtool: Fix " tip-bot for Jiri Slaby
  0 siblings, 2 replies; 3+ messages in thread
From: Jiri Slaby @ 2016-12-05 10:55 UTC (permalink / raw)
  To: mingo; +Cc: linux-kernel, Jiri Slaby, Josh Poimboeuf

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 <jslaby@suse.cz>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
---
 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 b63a31be1218..5e0dea2cdc01 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)
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] objtool: fix bytes check of lea's rex_prefix
  2016-12-05 10:55 [PATCH] objtool: fix bytes check of lea's rex_prefix Jiri Slaby
@ 2016-12-05 20:24 ` Josh Poimboeuf
  2016-12-06 10:10 ` [tip:core/urgent] objtool: Fix " tip-bot for Jiri Slaby
  1 sibling, 0 replies; 3+ messages in thread
From: Josh Poimboeuf @ 2016-12-05 20:24 UTC (permalink / raw)
  To: Jiri Slaby; +Cc: mingo, linux-kernel

On Mon, Dec 05, 2016 at 11:55:51AM +0100, Jiri Slaby wrote:
> 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 <jslaby@suse.cz>
> Cc: Josh Poimboeuf <jpoimboe@redhat.com>

Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [tip:core/urgent] objtool: Fix bytes check of lea's rex_prefix
  2016-12-05 10:55 [PATCH] objtool: fix bytes check of lea's rex_prefix Jiri Slaby
  2016-12-05 20:24 ` Josh Poimboeuf
@ 2016-12-06 10:10 ` tip-bot for Jiri Slaby
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Jiri Slaby @ 2016-12-06 10:10 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: luto, jslaby, peterz, jpoimboe, mingo, tglx, brgerst, hpa,
	dvlasenk, torvalds, bp, linux-kernel

Commit-ID:  69042bf2001b44e81cd86ab11a4637b9d9a14c5a
Gitweb:     http://git.kernel.org/tip/69042bf2001b44e81cd86ab11a4637b9d9a14c5a
Author:     Jiri Slaby <jslaby@suse.cz>
AuthorDate: Mon, 5 Dec 2016 11:55:51 +0100
Committer:  Ingo Molnar <mingo@kernel.org>
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 <jslaby@suse.cz>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20161205105551.25917-1-jslaby@suse.cz
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 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)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-12-06 10:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-12-05 10:55 [PATCH] objtool: fix bytes check of lea's rex_prefix Jiri Slaby
2016-12-05 20:24 ` Josh Poimboeuf
2016-12-06 10:10 ` [tip:core/urgent] objtool: Fix " tip-bot for Jiri Slaby

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).