| Titolo | radare2 radiff2 5.9.9 and master branch Memory corruption |
|---|
| Descrizione | Summary
Double-Free Error in radiff2 Tool
Environment
radare2 version: 5.9.9 and master branch
Commit: git.5.9.9
Build options: gpl release -O1 cs:5 cl:2 make
Operating System: Ubuntu 22.04 x86_64
Architecture: x86_64
Steps to reproduce
export CFLAGS="-g -O0 -fno-inline -fno-lto -fsanitize=address"
export CXXFLAGS="-g -O0 -fno-inline -fno-lto -fsanitize=address"
./configure --without-qjs
make -j64 & make install
radiff2 -AA -b 16 -c px -d -D -g 10,20 -j -m d -p -r -T -u POC1 POC2
=================================================================
==305258==ERROR: AddressSanitizer: attempting double-free on 0x606000003320 in thread T2:
#0 0x7f0158541537 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:127
#1 0x7f0158146d2b in r_cons_pal_init /root/this-program/radare2-dfe3eea/libr/cons/pal.c:172
#2 0x7f0157962d84 in cmd_load_theme cmd_eval.inc.c:203
#3 0x7f0157960d2b in cmd_ec cmd_eval.inc.c
#4 0x7f015785067d in cmd_eval cmd_eval.inc.c:814
#5 0x7f0157a8265b in r_cmd_call /root/this-program/radare2-dfe3eea/libr/core/cmd_api.c:423
#6 0x7f01579e3706 in cb_scrrainbow /root/this-program/radare2-dfe3eea/libr/core/cconfig.c
#7 0x7f01580f12e4 in r_config_set_cb /root/this-program/radare2-dfe3eea/libr/config/config.c:404
#8 0x7f01579d9c01 in r_core_config_init /root/this-program/radare2-dfe3eea/libr/core/cconfig.c:3818
#9 0x7f01577d5028 in r_core_init /root/this-program/radare2-dfe3eea/libr/core/core.c:2754
#10 0x7f01577d41d8 in r_core_new /root/this-program/radare2-dfe3eea/libr/core/core.c:386
#11 0x7f0154d42d06 in opencore /root/this-program/radare2-dfe3eea/libr/main/radiff2.c:78
#12 0x7f0154d42cac in thready_core /root/this-program/radare2-dfe3eea/libr/main/radiff2.c:1313
#13 0x7f0157e07038 in _r_th_launcher /root/this-program/radare2-dfe3eea/libr/util/thread.c:53
#14 0x7f0154b6cac2 in start_thread nptl/pthread_create.c:442
#15 0x7f0154bfe84f (/lib/x86_64-linux-gnu/libc.so.6+0x12684f)
0x606000003320 is located 0 bytes inside of 64-byte region [0x606000003320,0x606000003360)
freed by thread T1 here:
#0 0x7f0158541537 in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:127
#1 0x7f0158146d2b in r_cons_pal_init /root/this-program/radare2-dfe3eea/libr/cons/pal.c:172
previously allocated by thread T1 here:
#0 0x7f0158541a57 in __interceptor_calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:154
#1 0x7f0158141d5e in r_cons_rgb_str_mode /root/this-program/radare2-dfe3eea/libr/cons/rgb.c:267
Thread T2 created by T0 here:
INFO: Analyze all flags starting with sym. and entry0 (aa)
INFO: Analyze imports (af@@@i)
INFO: Analyze symbols (af@@@s)
INFO: Analyze all functions arguments/locals (afva@@@f)
INFO: Analyze function calls (aac)
#0 0x7f01584e5685 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216
#1 0x7f0157e06ea9 in r_th_new /root/this-program/radare2-dfe3eea/libr/util/thread.c:259
Thread T1 created by T0 here:
#0 0x7f01584e5685 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:216
#1 0x7f0157e06ea9 in r_th_new /root/this-program/radare2-dfe3eea/libr/util/thread.c:259
SUMMARY: AddressSanitizer: double-free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:127 in __interceptor_free
==305258==ABORTING
POC
https://drive.google.com/file/d/1joXpofhKSeb3uJ034ayVuWIoJj08gm_9/view?usp=sharing
Credit
Xiaoguo Li (CUPL)
Xudong Cao (UCAS) |
|---|
| Fonte | ⚠️ https://github.com/radareorg/radare2/issues/24231 |
|---|
| Utente | rootsec (UID 85929) |
|---|
| Sottomissione | 29/05/2025 18:54 (1 Anno fa) |
|---|
| Moderazione | 04/06/2025 14:05 (6 days later) |
|---|
| Stato | Accettato |
|---|
| Voce VulDB | 311130 [Radare2 5.9.9 radiff2 /libr/cons/pal.c r_cons_pal_init buffer overflow] |
|---|
| Punti | 20 |
|---|