radareorg / radare2

UNIX-like reverse engineering framework and command-line toolset
https://www.radare.org/
GNU Lesser General Public License v3.0
20.47k stars 2.98k forks source link

Googlefuzz PE issue #12066

Closed radare closed 2 years ago

radare commented 5 years ago

Regressions introduced after 4e8eed0158eef42888b2d9afb3d33fe4fb02409b

clusterfuzz-testcase-minimized-ia_fuzz-5716971732074496.dms.zip

PEFUZ.dms.zip

radare commented 5 years ago
Warning: section @` not aligned to SectionAlignment.
Warning: section sect_4 not aligned to SectionAlignment.
Warning: section ����H�� not aligned to SectionAlignment.
Warning: section .�^H1�H� not aligned to SectionAlignment.
Warning: section H�����H not aligned to SectionAlignment.
Warning: section sect_20 not aligned to SectionAlignment.
Warning: section sect_21 not aligned to SectionAlignment.
Warning: section sect_22 not aligned to SectionAlignment.
Warning: section sect_25 not aligned to SectionAlignment.
Warning: section sect_28 not aligned to SectionAlignment.
Warning: section �������� not aligned to SectionAlignment.
Warning: Invalid import directory size: 0x400 is now 0x28
vaddr greater than the file
Warning: read (image_tls_directory)
Error parsing resource directory
Warning: Invalid entrypoint ... trying to fix it but i do not promise nothing
Warning: Cannot read entry at 0xfe109589
Warning: Cannot read entry at 0xfe109589
Warning: Cannot read entry at 0xfe109589
/Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:2909:38: runtime error: member access within misaligned address 0x61a000027581 for type 'Pe32_image_import_directory', which requires 4 byte alignment
0x61a000027581: note: pointer points here
 00 67 00  00 00 09 00 00 00 02 00  00 00 04 83 04 08 04 03  00 00 08 00 00 00 05 00  00 00 00 00 00
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:2909:38 in
/Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:2909:38: runtime error: load of misaligned address 0x61a00002758d for type 'unsigned int', which requires 4 byte alignment
0x61a00002758d: note: pointer points here
 00 04 83 04 08 04 03  00 00 08 00 00 00 05 00  00 00 00 00 00 00 04 00  00 00 00 08 00 00 00 70  00
             ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:2909:38 in
/Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:2921:21: runtime error: member access within misaligned address 0x61a000027581 for type 'Pe32_image_import_directory', which requires 4 byte alignment
0x61a000027581: note: pointer points here
 00 67 00  00 00 09 00 00 00 02 00  00 00 04 83 04 08 04 03  00 00 08 00 00 00 05 00  00 00 00 00 00
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:2921:21 in
/Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:2921:21: runtime error: load of misaligned address 0x61a000027591 for type 'unsigned int', which requires 4 byte alignment
0x61a000027591: note: pointer points here
 08 04 03  00 00 08 00 00 00 05 00  00 00 00 00 00 00 04 00  00 00 00 08 00 00 00 70  00 00 00 00 00
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:2921:21 in
/Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:2925:39: runtime error: member access within misaligned address 0x61a000027581 for type 'Pe32_image_import_directory', which requires 4 byte alignment
0x61a000027581: note: pointer points here
 00 67 00  00 00 09 00 00 00 02 00  00 00 04 83 04 08 04 03  00 00 08 00 00 00 05 00  00 00 00 00 00
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:2925:39 in
/Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:2925:39: runtime error: load of misaligned address 0x61a00002758d for type 'unsigned int', which requires 4 byte alignment
0x61a00002758d: note: pointer points here
 00 04 83 04 08 04 03  00 00 08 00 00 00 05 00  00 00 00 00 00 00 04 00  00 00 00 08 00 00 00 70  00
             ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:2925:39 in
/Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:3033:21: runtime error: member access within misaligned address 0x61a000027581 for type 'Pe32_image_import_directory', which requires 4 byte alignment
0x61a000027581: note: pointer points here
 00 67 00  00 00 09 00 00 00 02 00  00 00 04 83 04 08 04 03  00 00 08 00 00 00 05 00  00 00 00 00 00
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:3033:21 in
/Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:3033:21: runtime error: load of misaligned address 0x61a000027591 for type 'unsigned int', which requires 4 byte alignment
0x61a000027591: note: pointer points here
 08 04 03  00 00 08 00 00 00 05 00  00 00 00 00 00 00 04 00  00 00 00 08 00 00 00 70  00 00 00 00 00
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:3033:21 in
/Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:3036:58: runtime error: member access within misaligned address 0x61a000027581 for type 'Pe32_image_import_directory', which requires 4 byte alignment
0x61a000027581: note: pointer points here
 00 67 00  00 00 09 00 00 00 02 00  00 00 04 83 04 08 04 03  00 00 08 00 00 00 05 00  00 00 00 00 00
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:3036:58 in
/Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:3036:58: runtime error: load of misaligned address 0x61a00002758d for type 'unsigned int', which requires 4 byte alignment
0x61a00002758d: note: pointer points here
 00 04 83 04 08 04 03  00 00 08 00 00 00 05 00  00 00 00 00 00 00 04 00  00 00 00 08 00 00 00 70  00
             ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:3036:58 in
Warning: read (libs - import dirs) 0
/Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:3069:33: runtime error: member access within misaligned address 0x61a000027081 for type 'Pe32_image_delay_import_directory', which requires 4 byte alignment
0x61a000027081: note: pointer points here
 00 00 23  4d 5a 00 00 00 45 4c 46  01 01 01 00 00 00 ff ff  ff ff 00 00 00 28 00 03  01 00 5f 5f 63
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:3069:33 in
/Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:3069:33: runtime error: load of misaligned address 0x61a000027085 for type 'unsigned int', which requires 4 byte alignment
0x61a000027085: note: pointer points here
 5a 00 00 00 45 4c 46  01 01 01 00 00 00 ff ff  ff ff 00 00 00 28 00 03  01 00 5f 5f 63 66 73 74  72
             ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:3069:33 in
/Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:3069:69: runtime error: member access within misaligned address 0x61a000027081 for type 'Pe32_image_delay_import_directory', which requires 4 byte alignment
0x61a000027081: note: pointer points here
 00 00 23  4d 5a 00 00 00 45 4c 46  01 01 01 00 00 00 ff ff  ff ff 00 00 00 28 00 03  01 00 5f 5f 63
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:3069:69 in
/Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:3069:69: runtime error: load of misaligned address 0x61a000027091 for type 'unsigned int', which requires 4 byte alignment
0x61a000027091: note: pointer points here
 00 ff ff  ff ff 00 00 00 28 00 03  01 00 5f 5f 63 66 73 74  72 69 6e 67 70 61 01 00  00 00 00 05 34
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:3069:69 in
/Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:3070:64: runtime error: member access within misaligned address 0x61a000027081 for type 'Pe32_image_delay_import_directory', which requires 4 byte alignment
0x61a000027081: note: pointer points here
 00 00 23  4d 5a 00 00 00 45 4c 46  01 01 01 00 00 00 ff ff  ff ff 00 00 00 28 00 03  01 00 5f 5f 63
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:3070:64 in
/Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:3070:64: runtime error: load of misaligned address 0x61a000027085 for type 'unsigned int', which requires 4 byte alignment
0x61a000027085: note: pointer points here
 5a 00 00 00 45 4c 46  01 01 01 00 00 00 ff ff  ff ff 00 00 00 28 00 03  01 00 5f 5f 63 66 73 74  72
             ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:3070:64 in
Warning: read (libs - import dirs) 0
/Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:2866:24: runtime error: member access within misaligned address 0x61a000027081 for type 'Pe32_image_debug_directory_entry', which requires 4 byte alignment
0x61a000027081: note: pointer points here
 00 00 23  4d 5a 00 00 00 45 4c 46  01 01 01 00 00 00 ff ff  ff ff 00 00 00 28 00 03  01 00 5f 5f 63
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:2866:24 in
/Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:2866:24: runtime error: load of misaligned address 0x61a000027099 for type 'unsigned int', which requires 4 byte alignment
0x61a000027099: note: pointer points here
 28 00 03  01 00 5f 5f 63 66 73 74  72 69 6e 67 70 61 01 00  00 00 00 05 34 00 20 00  09 00 28 00 50
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:2866:24 in
/Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:2867:22: runtime error: member access within misaligned address 0x61a000027081 for type 'Pe32_image_debug_directory_entry', which requires 4 byte alignment
0x61a000027081: note: pointer points here
 00 00 23  4d 5a 00 00 00 45 4c 46  01 01 01 00 00 00 ff ff  ff ff 00 00 00 28 00 03  01 00 5f 5f 63
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:2867:22 in
/Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:2867:22: runtime error: load of misaligned address 0x61a000027091 for type 'unsigned int', which requires 4 byte alignment
0x61a000027091: note: pointer points here
 00 ff ff  ff ff 00 00 00 28 00 03  01 00 5f 5f 63 66 73 74  72 69 6e 67 70 61 01 00  00 00 00 05 34
              ^
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/pancake/prg/radare2/libr/..//libr/bin/p/../format/pe/pe.c:2867:22 in
Warning: read (libs - import dirs) 0
asm.arch: Cannot setup '65535' bits analysis engine
 -- You can use registers in math expressions. For example: 'wx 1234 @ esp - 2'
[0x48aa9aae]>
radare commented 5 years ago

i added another PE from gfuzz that spots more UB in the pe p arser

radare commented 5 years ago

Proper fix requires more time and it's not a real issue for most users, moved to 3.2

radare commented 5 years ago

enotime for this release

trufae commented 2 years ago

I fixed all this long time ago. closing