Menu

#184 heap-buffer-overflow on create_line_with_spline()

fig2dev
pending
nobody
None
2025-03-29
2025-01-20
No

version: fig2dev Version 3.2.9a
system: ubuntu22.04

use this command to reproduce: fig2dev -L pict2e ./poc

message from ASAN:
==3350388==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x61d000000a78 at pc 0x557beb88f445 bp 0x7ffcee8e36c0 sp 0x7ffcee8e36b0
READ of size 4 at 0x61d000000a78 thread T0
#0 0x557beb88f444 in create_line_with_spline /home/ubuntu/asan_program/fig2dev-3.2.9a/fig2dev/trans_spline.c:585
#1 0x557beb9561b5 in put_patternoval /home/ubuntu/asan_program/fig2dev-3.2.9a/fig2dev/dev/genpict2e.c:1969
#2 0x557beb9561b5 in genpict2e_line /home/ubuntu/asan_program/fig2dev-3.2.9a/fig2dev/dev/genpict2e.c:1782
#3 0x557beb843536 in gendev_objects /home/ubuntu/asan_program/fig2dev-3.2.9a/fig2dev/fig2dev.c:1038
#4 0x557beb843536 in main /home/ubuntu/asan_program/fig2dev-3.2.9a/fig2dev/fig2dev.c:538
#5 0x7fc2926fbd8f in __libc_start_call_main ../sysdeps/nptl/libc_start_call_main.h:58
#6 0x7fc2926fbe3f in __libc_start_main_impl ../csu/libc-start.c:392
#7 0x557beb844f54 in _start (/home/ubuntu/target_program/fig2dev-3.2.9a/fig2dev/output2/asan_fig2dev+0x6ff54)

0x61d000000a78 is located 8 bytes to the left of 2400-byte region [0x61d000000a80,0x61d0000013e0)
allocated by thread T0 here:
#0 0x7fc292aed867 in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
#1 0x557beb88ca6a in init_point_array /home/ubuntu/asan_program/fig2dev-3.2.9a/fig2dev/trans_spline.c:103
#2 0x557beb88ca6a in compute_closed_spline /home/ubuntu/asan_program/fig2dev-3.2.9a/fig2dev/trans_spline.c:225

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/ubuntu/asan_program/fig2dev-3.2.9a/fig2dev/trans_spline.c:585 in create_line_with_spline
Shadow bytes around the buggy address:
0x0c3a7fff80f0: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c3a7fff8100: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c3a7fff8110: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c3a7fff8120: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd
0x0c3a7fff8130: fd fd fd fd fd fd fd fd fd fd fd fd fa fa fa fa
=>0x0c3a7fff8140: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa[fa]
0x0c3a7fff8150: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c3a7fff8160: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c3a7fff8170: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c3a7fff8180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
0x0c3a7fff8190: 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
Shadow gap: cc
==3350388==ABORTING

1 Attachments

Discussion

  • tkl

    tkl - 2025-01-23
    • status: open --> pending
     
  • tkl

    tkl - 2025-01-23

    Fixed with commit [da8992].

     

    Related

    Commit: [da8992]

  • Roland Rosenfeld

     

Log in to post a comment.