comdb2 icon indicating copy to clipboard operation
comdb2 copied to clipboard

A global-buffer-overflow error when fuzzing ASAN hardened comdb2

Open Ljiee opened this issue 6 years ago • 1 comments

Command: ./comdb2 --lrl ./db/testdb.lrl testdb

=================================================================
==2105479==ERROR: AddressSanitizer: global-buffer-overflow on address 0x5555b06d269f at pc 0x5555af46905e bp 0x7ffca7dfa800 sp 0x7ffca7dfa7f8
READ of size 1 at 0x5555b06d269f thread T0
    #0 0x5555af46905d in comdb2ma_create_int /root/workspace/comdb2/sources/mem/mem.c:1223:41
    #1 0x5555af470c3f in comdb2ma_create_with_callback /root/workspace/comdb2/sources/mem/mem.c:665:17
    #2 0x5555aea3529f in SERVER_sbuf2open /root/workspace/comdb2/sources/util/sbuf2.c:806:22
    #3 0x5555aea149a5 in portmux_cmd /root/workspace/comdb2/sources/util/portmuxusr.c:178:10
    #4 0x5555ade40db4 in setup_net_listen_all /root/workspace/comdb2/sources/db/glue.c:5954:20
    #5 0x5555adc8bab7 in init /root/workspace/comdb2/sources/db/comdb2.c:3730:10
    #6 0x5555adc86e95 in main /root/workspace/comdb2/sources/db/comdb2.c:5466:9
    #7 0x7f6e940c4001 in __libc_start_main (/usr/lib/libc.so.6+0x27001)
    #8 0x5555adb5f7cd in _start (/root/workspace/comdb2/bin_asan/comdb2+0x6eb7cd)

0x5555b06d269f is located 1 bytes to the left of global variable 'debug_switches' defined in '/root/workspace/comdb2/sources/mem/mem.c:378:22' (0x5555b06d26a0) of size 12
0x5555b06d269f is located 62 bytes to the right of global variable 'debug_master_switch' defined in '/root/workspace/comdb2/sources/mem/mem.c:377:22' (0x5555b06d2660) of size 1
  'debug_master_switch' is ascii string ''
SUMMARY: AddressSanitizer: global-buffer-overflow /root/workspace/comdb2/sources/mem/mem.c:1223:41 in comdb2ma_create_int
Shadow bytes around the buggy address:
  0x0aab360d2480: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0aab360d2490: 04 f9 f9 f9 f9 f9 f9 f9 00 00 00 00 04 f9 f9 f9
  0x0aab360d24a0: f9 f9 f9 f9 00 00 00 00 00 00 00 00 00 00 00 00
  0x0aab360d24b0: f9 f9 f9 f9 01 f9 f9 f9 f9 f9 f9 f9 04 f9 f9 f9
  0x0aab360d24c0: f9 f9 f9 f9 04 f9 f9 f9 f9 f9 f9 f9 01 f9 f9 f9
=>0x0aab360d24d0: f9 f9 f9[f9]00 04 f9 f9 f9 f9 f9 f9 00 00 00 00
  0x0aab360d24e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0aab360d24f0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0aab360d2500: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0aab360d2510: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0aab360d2520: 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
==2105479==ABORTING

Ljiee avatar May 17 '20 11:05 Ljiee

Thank you for reporting the bug to us! It's fixed in the latest master.

riverszhang89 avatar Aug 03 '20 17:08 riverszhang89