Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASan: heap-buffer-overflow ./nfdump/bin/exporter.c:184 in AddSamplerInfo #176

Closed
fgeek opened this issue Aug 4, 2019 · 1 comment

Comments

@fgeek
Copy link

commented Aug 4, 2019

Tested commit: 0b45172
Credits: Henri Salo
Tools: american fuzzy lop 2.53b, afl-utils
004-nfcapd.txt (a5bf0b58eb1c165f9288c584f99bdf1f555189ff)

./nfdump -r 004-nfcapd.txt          Date first seen          Duration Proto      Src IP Addr:Port          Dst IP Addr:Port   Packets    Bytes Flows
=================================================================
==9012==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x7f1c7e1df7f8 at pc 0x7f1c81023db6 bp 0x7ffee7970650 sp 0x7ffee7970648
READ of size 8 at 0x7f1c7e1df7f8 thread T0
    #0 0x7f1c81023db5 in AddSamplerInfo /home/hsalo/src/nfdump/bin/exporter.c:184
    #1 0x55fca6d413c7 in process_data /home/hsalo/src/nfdump/bin/nfdump.c:665
    #2 0x55fca6d413c7 in main /home/hsalo/src/nfdump/bin/nfdump.c:1213
    #3 0x7f1c80d5909a in __libc_start_main ../csu/libc-start.c:308
    #4 0x55fca6d49499 in _start (/home/hsalo/builds/nfdump/0b45172134d354081d80212cb33e224a46c48298/bin/nfdump+0x1a499)

0x7f1c7e1df7f8 is located 0 bytes to the right of 524280-byte region [0x7f1c7e15f800,0x7f1c7e1df7f8)
allocated by thread T0 here:
    #0 0x7f1c81160518 in calloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe9518)
    #1 0x7f1c810227fa in InitExporterList /home/hsalo/src/nfdump/bin/exporter.c:87

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/hsalo/src/nfdump/bin/exporter.c:184 in AddSamplerInfo
Shadow bytes around the buggy address:
  0x0fe40fc33ea0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe40fc33eb0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe40fc33ec0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe40fc33ed0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x0fe40fc33ee0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x0fe40fc33ef0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00[fa]
  0x0fe40fc33f00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe40fc33f10: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe40fc33f20: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe40fc33f30: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x0fe40fc33f40: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
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
==9012==ABORTING
$ hexdump -C 004-nfcapd.txt
00000000  0c a5 01 00 00 30 30 30  30 30 30 30 30 30 30 30  |.....00000000000|
00000010  30 30 30 30 30 30 30 30  30 30 30 30 30 30 30 30  |0000000000000000|
*
00000110  30 30 30 30 30 30 30 30  30 00 00 00 02 00 30 30  |000000000.....00|
00000120  09 00 30 00 30 30 30 30  30 30 30 30 30 30 ff ff  |..0.0000000000..|
00000130  30 30 30 30 30 30 30 30  30 30 30 30 30 30 30 30  |0000000000000000|
*
00000150
phaag pushed a commit that referenced this issue Aug 5, 2019
@phaag

This comment has been minimized.

Copy link
Owner

commented Aug 5, 2019

Fixed in 8d1888.
Thanks for reporting.

@phaag phaag closed this Aug 5, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.