Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

global-buffer-overflow in /radare2/libr/arch/p/nds32/nds32-dis.h:993:6 in print_insn32_fpu #22333

Closed
gandalf4a opened this issue Oct 20, 2023 · 0 comments

Comments

@gandalf4a
Copy link

Version

$ r2  -v
radare2 5.8.9 31339 @ linux-x86-64
birth: git.5.8.8-691-gb2de2288d8 2023-10-17__01:18:28
commit: b2de2288d8299f89288c503fc2ce22381b61aba0

Platform

$ uname -a
Linux user-GE40-2PC-Dragon-Eyes 6.2.0-33-generic #33~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Sep  7 10:33:52 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Asan

[35mWARN:[0m Relocs has not been applied. Please use `-e bin.relocs.apply=true` or `-e bin.cache=true` next time
[33mINFO:[0m Analyze all flags starting with sym. and entry0 (aa)
[33mINFO:[0m Analyze imports (af@@@i)
[35mWARN:[0m set your favourite calling convention in `e anal.cc=?`
[33mINFO:[0m Analyze symbols (af@@@s)
[33mINFO:[0m Recovering variables
[33mINFO:[0m Analyze all functions arguments/locals (afva@@@F)
[2K
[33mINFO:[0m Analyze function calls (aac)
=================================================================
==3834464==ERROR: AddressSanitizer: global-buffer-overflow on address 0x7f0145244288 at pc 0x7f01442680a9 bp 0x7fff92e713a0 sp 0x7fff92e71398
READ of size 8 at 0x7f0145244288 thread T0
    #0 0x7f01442680a8 in print_insn32_fpu /home/user/fuzzing_radare2/radare2/libr/arch/p/nds32/nds32-dis.h:993:6
    #1 0x7f0144261c25 in print_insn32 /home/user/fuzzing_radare2/radare2/libr/arch/p/nds32/nds32-dis.h:1246:7
    #2 0x7f0144261c25 in print_insn_nds32 /home/user/fuzzing_radare2/radare2/libr/arch/p/nds32/nds32-dis.h:1276:3
    #3 0x7f0144265882 in decode /home/user/fuzzing_radare2/radare2/libr/arch/p/nds32/plugin.c:135:13
    #4 0x7f0143d62c85 in r_arch_decode /home/user/fuzzing_radare2/radare2/libr/arch/arch.c:320:9
    #5 0x7f01422629cf in r_anal_op /home/user/fuzzing_radare2/radare2/libr/anal/op.c:186:8
    #6 0x7f01460330ad in _anal_calls /home/user/fuzzing_radare2/radare2/libr/core/./cmd_anal.inc.c:9005:7
    #7 0x7f0146030630 in cmd_anal_calls /home/user/fuzzing_radare2/radare2/libr/core/./cmd_anal.inc.c:9125:5
    #8 0x7f0146022fc2 in cmd_anal_all /home/user/fuzzing_radare2/radare2/libr/core/./cmd_anal.inc.c:12982:11
    #9 0x7f0145f37429 in cmd_anal /home/user/fuzzing_radare2/radare2/libr/core/./cmd_anal.inc.c:14267:8
    #10 0x7f0147292940 in perform_analysis /home/user/fuzzing_radare2/radare2/libr/main/radare2.c:499:2
    #11 0x7f014728831d in r_main_radare2 /home/user/fuzzing_radare2/radare2/libr/main/radare2.c:1720:4
    #12 0x55727ae3552d in main /home/user/fuzzing_radare2/radare2/binr/radare2/radare2.c:114:9
    #13 0x7f0146829d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
    #14 0x7f0146829e3f in __libc_start_main csu/../csu/libc-start.c:392:3
    #15 0x55727ad77444 in _start (/home/user/fuzzing_radare2/radare2/binr/radare2/radare2+0x1f444) (BuildId: 655cd64f4959101bcf192e77bc6bf062577e0708)

0x7f0145244288 is located 24 bytes to the left of global variable 'mnemonic_fd2_cmp' defined in 'p/nds32/nds32-dis.h:155:20' (0x7f01452442a0) of size 64
0x7f0145244288 is located 8 bytes to the right of global variable 'mnemonic_fs2_cmp' defined in 'p/nds32/nds32-dis.h:149:20' (0x7f0145244240) of size 64
SUMMARY: AddressSanitizer: global-buffer-overflow /home/user/fuzzing_radare2/radare2/libr/arch/p/nds32/nds32-dis.h:993:6 in print_insn32_fpu
Shadow bytes around the buggy address:
  0x0fe0a8a40800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe0a8a40810: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe0a8a40820: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe0a8a40830: 00 00 00 00 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9
  0x0fe0a8a40840: f9 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
=>0x0fe0a8a40850: f9[f9]f9 f9 00 00 00 00 00 00 00 00 f9 f9 f9 f9
  0x0fe0a8a40860: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe0a8a40870: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe0a8a40880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe0a8a40890: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe0a8a408a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Shadow byte legend (one shadow byte represents 8 application bytes):
  Addressable:           00
  Partially addressable: 01 02 03 04 05 06 07 
  Heap left redzone:       fa
  Freed heap region:       fd
  Stack left redzone:      f1
  Stack mid redzone:       f2
  Stack right redzone:     f3
  Stack after return:      f5
  Stack use after scope:   f8
  Global redzone:          f9
  Global init order:       f6
  Poisoned by user:        f7
  Container overflow:      fc
  Array cookie:            ac
  Intra object redzone:    bb
  ASan internal:           fe
  Left alloca redzone:     ca
  Right alloca redzone:    cb
==3834464==ABORTING

Reproduce

r2 -A -q poc

POC File

https://github.com/gandalf4a/crash_report/blob/main/radare2/r2/gbo_993

Credit

Gandalf4a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant