[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [UNIKRAFT PATCH] lib/ukdebug: asmdump: Stop on decoding errors



Sorry, please ignore this patch. I sent a v2.

Thanks,

Simon

On 04.05.20 11:18, Simon Kuenzer wrote:
Checks for errors that may occur during instruction decoding with
libzydis.

Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
---
  lib/ukdebug/asmdump.c | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/ukdebug/asmdump.c b/lib/ukdebug/asmdump.c
index f73b0d65..7f992930 100644
--- a/lib/ukdebug/asmdump.c
+++ b/lib/ukdebug/asmdump.c
@@ -76,7 +76,8 @@ static int _asmdump(struct out_dev *o,
while (count) {
                addr = ((__uptr) instr) + offset;
-               ZydisDecoderDecodeBuffer(&dcr, (const void *) addr, 16, &ins);
+               if (!ZYAN_SUCCESS(ZydisDecoderDecodeBuffer(&dcr, (const void *) 
addr, 16, &ins)))
+                       break;
                ZydisFormatterFormatInstruction(&fmt, &ins, buf, sizeof(buf),
                                                addr);
                ret = outf(o, "%08"__PRIuptr" <+%d>: %hs\n", addr, offset, buf);




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.