=================================================================
==3311835==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6060000001e0 at pc 0x5555556ae61e bp 0x7fffffffc7d0 sp 0x7fffffffc7c8
READ of size 8 at 0x6060000001e0 thread T0
#0 0x5555556ae61d in ucl_object_dtor_free /home/gabesherman/harness_test/AutoHarn-Evaluation/ucl/lib_asan/src/ucl_util.c:212:12
#1 0x5555556dfee6 in ucl_object_dtor_unref /home/gabesherman/harness_test/AutoHarn-Evaluation/ucl/lib_asan/src/ucl_util.c:244:3
#2 0x5555556adf09 in ucl_object_free_internal /home/gabesherman/harness_test/AutoHarn-Evaluation/ucl/lib_asan/src/ucl_util.c:286:3
#3 0x5555556f2fda in ucl_object_dtor_unref_single /home/gabesherman/harness_test/AutoHarn-Evaluation/ucl/lib_asan/src/ucl_util.c:235:4
#4 0x5555556dfef4 in ucl_object_dtor_unref /home/gabesherman/harness_test/AutoHarn-Evaluation/ucl/lib_asan/src/ucl_util.c:248:3
#5 0x5555556adf09 in ucl_object_free_internal /home/gabesherman/harness_test/AutoHarn-Evaluation/ucl/lib_asan/src/ucl_util.c:286:3
#6 0x5555556b9b9d in ucl_object_unref /home/gabesherman/harness_test/AutoHarn-Evaluation/ucl/lib_asan/src/ucl_util.c:3685:4
#7 0x5555556b5158 in ucl_parser_free /home/gabesherman/harness_test/AutoHarn-Evaluation/ucl/lib_asan/src/ucl_util.c:621:3
#8 0x5555556ad34e in main /home/gabesherman/harness_test/AutoHarn-Results/ucl/hopper-28/reproducer.c:51:5
#9 0x7ffff7c29d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#10 0x7ffff7c29e3f in __libc_start_main csu/../csu/libc-start.c:392:3
#11 0x5555555ef3e4 in _start (/home/gabesherman/harness_test/AutoHarn-Results/ucl/hopper-28/reproducer+0x9b3e4) (BuildId: b53fb487f27249d4f11f8b4c7d5b9b070f30b5ee)
0x6060000001e0 is located 0 bytes to the right of 64-byte region [0x6060000001a0,0x6060000001e0)
allocated by thread T0 here:
#0 0x55555567222e in __interceptor_malloc (/home/gabesherman/harness_test/AutoHarn-Results/ucl/hopper-28/reproducer+0x11e22e) (BuildId: b53fb487f27249d4f11f8b4c7d5b9b070f30b5ee)
#1 0x5555556dd6c4 in ucl_object_copy_internal /home/gabesherman/harness_test/AutoHarn-Evaluation/ucl/lib_asan/src/ucl_util.c:3608:8
#2 0x5555556df778 in ucl_object_copy_internal /home/gabesherman/harness_test/AutoHarn-Evaluation/ucl/lib_asan/src/ucl_util.c:3658:24
#3 0x5555556c8149 in ucl_object_copy /home/gabesherman/harness_test/AutoHarn-Evaluation/ucl/lib_asan/src/ucl_util.c:3672:9
#4 0x5555557233d2 in ucl_set_include_path /home/gabesherman/harness_test/AutoHarn-Evaluation/ucl/lib_asan/src/ucl_parser.c:3173:26
#5 0x5555556ad1a0 in main /home/gabesherman/harness_test/AutoHarn-Results/ucl/hopper-28/reproducer.c:33:16
#6 0x7ffff7c29d8f in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
SUMMARY: AddressSanitizer: heap-buffer-overflow /home/gabesherman/harness_test/AutoHarn-Evaluation/ucl/lib_asan/src/ucl_util.c:212:12 in ucl_object_dtor_free
Shadow bytes around the buggy address:
0x0c0c7fff7fe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c0c7fff7ff0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c0c7fff8000: fa fa fa fa 00 00 00 00 00 00 00 00 fa fa fa fa
0x0c0c7fff8010: 00 00 00 00 00 00 00 06 fa fa fa fa 00 00 00 00
0x0c0c7fff8020: 00 00 00 00 fa fa fa fa fd fd fd fd fd fd fd fd
=>0x0c0c7fff8030: fa fa fa fa 00 00 00 00 00 00 00 00[fa]fa fa fa
0x0c0c7fff8040: fd fd fd fd fd fd fd fd fa fa fa fa fd fd fd fd
0x0c0c7fff8050: fd fd fd fd fa fa fa fa fd fd fd fd fd fd fd fd
0x0c0c7fff8060: fa fa fa fa fd fd fd fd fd fd fd fd fa fa fa fa
0x0c0c7fff8070: fd fd fd fd fd fd fd fd fa fa fa fa fd fd fd fd
0x0c0c7fff8080: fd fd fd fd fa fa fa fa fd fd fd fd fd fd fd fd
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
==3311835==ABORTING
You cannot use USERDATA object as normal objects, they are intended just to pass data from and within lua. Again, this is something nobody will use but I should probably add another fool protection here.
A heap-buffer overflow occurs in the below program. This behavior occurs at line 212 in ucl_util.c
Test Environment
Ubuntu 22.04, 64bit
How to trigger
./filename
Version
Latest: f897d5a0fed3a4474a4c3137c7b92853845fed47
Address Sanitizer Output