File kdumpid-x86-out-of-bounds-disas.patch of Package kdumpid
Date: Tue Nov 4 00:15:37 2014 +0100
From: Petr Tesarik <petr@tesarici.cz>
Subject: x86: Prevent out-of-bounds reads in disas_at()
Patch-mainline: v1.1
Git-commit: a6baa2d02f125fd76f4ece14bea9d922e19b10e3
Since the buffer_vma is already subtracted from the target address,
the condition should simply check that a is within the target page.
Signed-off-by: Petr Tesarik <petr@tesarici.cz>
---
x86.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/x86.c
+++ b/x86.c
@@ -171,7 +171,7 @@ disas_at(struct dump_desc *dd, struct di
int cont = strncmp(insn, "jmp", 3);
a -= info->buffer_vma;
- if (a < info->buffer_vma + dd->page_size) {
+ if (a < dd->page_size) {
priv->initstate = state;
++priv->initstate.depth;
if (disas_at(dd, info, a) > 0)