Menu ▾ ▴

#79 global-buffer-overflow in arrow_path at gensvg.c:1081

fig2dev
closed
nobody
None
2020-12-21
2019-12-28
Suhwan Song
No

Hi,
I found a global-buffer-overflow in arrow_path at gensvg.c:1081

fig2dev Version 3.2.7b
commit 93795dd396730c80e63767dede7777f4cb7dc383

Please run following command to reproduce it,

fig2dev -L svg $PoC

ASAN LOG

==2466==ERROR: AddressSanitizer: global-buffer-overflow on address 0x0000018f63b8 at pc 0x0000008af2a4 bp 0x7ffc7c69c5a0 sp 0x7ffc7c69c598
READ of size 4 at 0x0000018f63b8 thread T0
    #0 0x8af2a3 in arrow_path /home/tmp/mcj-fig2dev/fig2dev/dev/gensvg.c:1081:40
    #1 0x89d608 in svg_arrows /home/tmp/mcj-fig2dev/fig2dev/dev/gensvg.c:1173:2
    #2 0x8a41f0 in gensvg_arc /home/tmp/mcj-fig2dev/fig2dev/dev/gensvg.c:906:9
    #3 0x54ba7b in gendev_objects /home/tmp/mcj-fig2dev/fig2dev/fig2dev.c:1012:6
    #4 0x54ba7b in main /home/tmp/mcj-fig2dev/fig2dev/fig2dev.c:489
    #5 0x7f6f8c222b96 in __libc_start_main /build/glibc-OTsEL5/glibc-2.27/csu/../csu/libc-start.c:310
    #6 0x41b429 in _start (/home/tmp/fig2dev+0x41b429)

0x0000018f63b8 is located 8 bytes to the left of global variable 'fpoints' defined in 'gensvg.c:1129:18' (0x18f63c0) of size 400
0x0000018f63b8 is located 52 bytes to the right of global variable 'bnclippoints' defined in 'gensvg.c:1128:41' (0x18f6380) of size 4
SUMMARY: AddressSanitizer: global-buffer-overflow /home/tmp/mcj-fig2dev/fig2dev/dev/gensvg.c:1081:40 in arrow_path
Shadow bytes around the buggy address:
  0x000080316c20: f9 f9 f9 f9 01 f9 f9 f9 f9 f9 f9 f9 00 f9 f9 f9
  0x000080316c30: f9 f9 f9 f9 01 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9
  0x000080316c40: f9 f9 f9 f9 00 00 00 00 04 f9 f9 f9 f9 f9 f9 f9
  0x000080316c50: 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9
  0x000080316c60: 04 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9
=>0x000080316c70: 04 f9 f9 f9 f9 f9 f9[f9]00 00 00 00 00 00 00 00
  0x000080316c80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080316c90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x000080316ca0: 00 00 00 00 00 00 00 00 00 00 f9 f9 f9 f9 f9 f9
  0x000080316cb0: f9 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 00 00 00 00
  0x000080316cc0: 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
==2466==ABORTING
1 Attachments

Discussion

  • tkl

    tkl - 2020-01-06
    • status: open --> pending
     
  • tkl

    tkl - 2020-01-06

    Fixed with commit [41b9bb].

     

    Related

    Commit: [41b9bb]

  • tkl

    tkl - 2020-12-21
    • status: pending --> closed
     

Log in to post a comment.