diff options
author | Peter Zijlstra <[email protected]> | 2014-12-16 11:46:14 +0100 |
---|---|---|
committer | Ingo Molnar <[email protected]> | 2015-01-09 11:12:26 +0100 |
commit | 0f363b250b15af0f218bb2876d101fe5cd413f8b (patch) | |
tree | ee748df1510d58c7895c0e151218ed6991ab4957 | |
parent | 300176af031a2b1b9cb08ce1459845dcb2fac1b9 (diff) |
x86: Fix off-by-one in instruction decoder
Stephane reported that the PEBS fixup was broken by the recent commit to
the instruction decoder. The thing had an off-by-one which resulted in
not being able to decode the last instruction and always bail.
Reported-by: Stephane Eranian <[email protected]>
Fixes: 6ba48ff46f76 ("x86: Remove arbitrary instruction size limit in instruction decoder")
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: [email protected] # 3.18
Cc: <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Liang Kan <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: Jim Keniston <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: Masami Hiramatsu <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Ingo Molnar <[email protected]>
-rw-r--r-- | arch/x86/lib/insn.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/lib/insn.c b/arch/x86/lib/insn.c index 2480978b31cc..1313ae6b478b 100644 --- a/arch/x86/lib/insn.c +++ b/arch/x86/lib/insn.c @@ -28,7 +28,7 @@ /* Verify next sizeof(t) bytes can be on the same instruction */ #define validate_next(t, insn, n) \ - ((insn)->next_byte + sizeof(t) + n < (insn)->end_kaddr) + ((insn)->next_byte + sizeof(t) + n <= (insn)->end_kaddr) #define __get_next(t, insn) \ ({ t r = *(t*)insn->next_byte; insn->next_byte += sizeof(t); r; }) |