Messages in this thread Patch in this message | | | From | Andy Lutomirski <> | Subject | [PATCH 3.19 v2 1/3] x86: Fix off-by-one in the instruction decoder length checks | Date | Mon, 12 Jan 2015 15:04:09 -0800 |
| |
If next_byte + sizeof(t) == end_kaddr, then we are trying to read exactly to the end; this should be allowed.
Fixes: 6ba48ff46f76 x86: Remove arbitrary instruction size limit in instruction decoder Signed-off-by: Andy Lutomirski <luto@amacapital.net> --- arch/x86/lib/insn.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
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; }) -- 2.1.0
| |