Skip to content
New issue

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

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

Already on GitHub? # to your account

rasm2 negative-size-param error in r_main_rasm2 #23953

Closed
Ekkosun opened this issue Feb 11, 2025 · 0 comments
Closed

rasm2 negative-size-param error in r_main_rasm2 #23953

Ekkosun opened this issue Feb 11, 2025 · 0 comments
Assignees
Milestone

Comments

@Ekkosun
Copy link

Ekkosun commented Feb 11, 2025

Environment

Tue 11 Feb 2025 01:34:43 PM CST
radare2 5.9.9 33286 @ linux-x86-32
birth: git.5.9.8-352-g473664b1e7 2025-02-11__13:11:21
commit: 473664b
options: gpl asan -O? cs:5 cl:2 make

Description

cmd: rasm2 -i 6 -E 'mov eax, 30'
expected: not crash
actually: crash

Test

1: compile radare2 with asan option on
2: run command rasm2 -i 6 -E 'mov eax, 30'

ASan log

./bins/bin/rasm2 -i 6 -E 'mov eax, 30'

==1539759==ERROR: AddressSanitizer: negative-size-param: (size=-1)
#0 0x556fedbb114c in __asan_memmove (./radare2/bins/bin/rasm2+0xa014c) (BuildId: c182a69a7b8fb8b422226bca07598a5ba9758698)
#1 0x7fb5c11d72cf in r_main_rasm2 ./radare2/libr/main/rasm2.c:1063:5
#2 0x556fedbec7a1 in main ./radare2/binr/rasm2/rasm2.c:6:9
#3 0x7fb5c0f9c082 in __libc_start_main /build/glibc-FcRMwW/glibc-2.31/csu/../csu/libc-start.c:308:16
#4 0x556fedb2f31d in _start (./radare2/bins/bin/rasm2+0x1e31d) (BuildId: c182a69a7b8fb8b422226bca07598a5ba9758698)

0x602000009ddc is located 0 bytes to the right of 12-byte region [0x602000009dd0,0x602000009ddc)
allocated by thread T0 here:
#0 0x556fedb9c4c3 in strdup (./radare2/bins/bin/rasm2+0x8b4c3) (BuildId: c182a69a7b8fb8b422226bca07598a5ba9758698)
#1 0x7fb5c11d7259 in r_main_rasm2 ./radare2/libr/main/rasm2.c:1059:19
#2 0x556fedbec7a1 in main ./radare2/binr/rasm2/rasm2.c:6:9
#3 0x7fb5c0f9c082 in __libc_start_main /build/glibc-FcRMwW/glibc-2.31/csu/../csu/libc-start.c:308:16

SUMMARY: AddressSanitizer: negative-size-param (./radare2/bins/bin/rasm2+0xa014c) (BuildId: c182a69a7b8fb8b422226bca07598a5ba9758698) in __asan_memmove
==1539759==ABORTING

radare added a commit that referenced this issue Feb 11, 2025
* The behaviour is not the expected
* Requires a refactoring to address it
* At least its not segfaulting now
@trufae trufae self-assigned this Feb 11, 2025
@trufae trufae added this to the 6.0.0 milestone Feb 11, 2025
@trufae trufae closed this as completed in c6c772d Feb 11, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants