Summary: | heap-buffer-overflow in disassemble_bytes | ||
---|---|---|---|
Product: | binutils | Reporter: | Alexandre Adamski <aadamski> |
Component: | binutils | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | nickc |
Priority: | P2 | ||
Version: | 2.29 | ||
Target Milestone: | --- | ||
Host: | Target: | ||
Build: | Last reconfirmed: | ||
Attachments: |
testcase_37a2b
report_37a2b testcase_77125 report_77125 testcase_c3269 report_c3269 |
Description
Alexandre Adamski
2017-06-13 17:46:48 UTC
Created attachment 10106 [details]
testcase_37a2b
Created attachment 10107 [details]
report_37a2b
Created attachment 10108 [details]
testcase_77125
Created attachment 10109 [details]
report_77125
Created attachment 10110 [details]
testcase_c3269
Created attachment 10111 [details]
report_c3269
Additional Information: The command used was `objdump -D <file>`. The compilation flags used were `-g -O2 -fno-omit-frame-pointer -fsanitize=address -fno-sanitize-recover=undefined`. The configuration settings used were `--enable-targets=all --disable-shared`. (In reply to Nick Clifton from comment #4) > Are you able to test out patches and see if they make a difference ? If so > please could you try out the uploaded patch which might make a difference. > For me, the bug goes away, but I cannot tell if I have really fixed the > problem, or if there is still some kind of stack corruption going on. I tried your patch with both the raw and the minimized testcases; it seems not to crash anymore. I have started an instance of AFL in "crash exploration" mode in order to generate more diverse testcases. I will report back in a few hours. Thanks a lot for all your bug fixes, you're doing god's work! :-) The master branch has been updated by Nick Clifton <nickc@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=ae87f7e73eba29bd38b3a9684a10b948ed715612 commit ae87f7e73eba29bd38b3a9684a10b948ed715612 Author: Nick Clifton <nickc@redhat.com> Date: Wed Jun 14 16:50:03 2017 +0100 Fix address violation when disassembling a corrupt binary. PR binutils/21580 binutils * objdump.c (disassemble_bytes): Check for buffer overrun when printing out rae insns. ld * testsuite/ld-nds32/diff.d: Adjust expected output. Hi Aadamski, Thanks for reporting this bug. The problem was a buffer overrun when printing out the raw bytes involved in the disassembly. I have checked in a fix to prevent this from happening so all should be well now. Cheers Nick |