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

Invalid free() in nDPI's serializer interface. #1978

Closed
utoni opened this issue May 16, 2023 · 0 comments · Fixed by #1979
Closed

Invalid free() in nDPI's serializer interface. #1978

utoni opened this issue May 16, 2023 · 0 comments · Fixed by #1979
Labels

Comments

@utoni
Copy link
Collaborator

utoni commented May 16, 2023

While upgrading nDPIds libnDPI, I've encuntered a memory error.

=================================================================
==109637==ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0x62d000064408 in thread T1
    #0 0x7f33b2f73b6f in __interceptor_free ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:123
    #1 0x5569a30fc4b2 in ndpi_term_serializer /home/toni/git/nDPId/libnDPI/src/lib/ndpi_serializer.c:435
    #2 0x5569a3066287 in free_workflow /home/toni/git/nDPId/nDPId.c:1469
    #3 0x5569a308a5e8 in free_reader_threads /home/toni/git/nDPId/nDPId.c:4734
    #4 0x5569a309be27 in nDPId_mainloop_thread /home/toni/git/nDPId/nDPId-test.c:1209
    #5 0x7f33b23b4ea6 in start_thread nptl/pthread_create.c:477
    #6 0x7f33b22d4a2e in __clone (/lib/x86_64-linux-gnu/libc.so.6+0xfba2e)

0x62d000064408 is located 8 bytes inside of 33800-byte region [0x62d000064400,0x62d00006c808)
allocated by thread T1 here:
    #0 0x7f33b2f73e8f in __interceptor_malloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:145
    #1 0x5569a30630ef in ndpi_malloc_wrapper /home/toni/git/nDPId/nDPId.c:1139
    #2 0x5569a30f70c5 in ndpi_calloc /home/toni/git/nDPId/libnDPI/src/lib/ndpi_memory.c:67
    #3 0x5569a30f8b88 in ndpi_init_serializer_buffer /home/toni/git/nDPId/libnDPI/src/lib/ndpi_serializer.c:202
    #4 0x5569a30fc65e in ndpi_init_serializer_ll /home/toni/git/nDPId/libnDPI/src/lib/ndpi_serializer.c:221
    #5 0x5569a3064aac in init_workflow /home/toni/git/nDPId/nDPId.c:1327
    #6 0x5569a3066919 in setup_reader_threads /home/toni/git/nDPId/nDPId.c:1544
    #7 0x5569a309a097 in nDPId_mainloop_thread /home/toni/git/nDPId/nDPId-test.c:1156
    #8 0x7f33b23b4ea6 in start_thread nptl/pthread_create.c:477

Thread T1 created by T0 here:
    #0 0x7f33b2f1f2a2 in __interceptor_pthread_create ../../../../src/libsanitizer/asan/asan_interceptors.cpp:214
    #1 0x5569a309c584 in main /home/toni/git/nDPId/nDPId-test.c:1307
    #2 0x7f33b21fcd09 in __libc_start_main ../csu/libc-start.c:308

Seems like a free to an invalid memory block. Double free? Dangling pointer? Investigation ongoing.

@utoni utoni added the bug label May 16, 2023
utoni added a commit to utoni/nDPI that referenced this issue May 16, 2023
 * added CI check

Signed-off-by: lns <matzeton@googlemail.com>
utoni added a commit to utoni/nDPI that referenced this issue May 16, 2023
 * added CI check

Signed-off-by: lns <matzeton@googlemail.com>
@utoni utoni pinned this issue May 16, 2023
@utoni utoni unpinned this issue May 16, 2023
@utoni utoni linked a pull request May 16, 2023 that will close this issue
utoni added a commit to utoni/nDPI that referenced this issue May 17, 2023
 * added CI check

Signed-off-by: lns <matzeton@googlemail.com>
utoni added a commit to utoni/nDPI that referenced this issue May 17, 2023
 * added CI check

Signed-off-by: lns <matzeton@googlemail.com>
utoni added a commit to utoni/nDPI that referenced this issue May 17, 2023
 * added CI check

Signed-off-by: lns <matzeton@googlemail.com>
utoni added a commit to utoni/nDPI that referenced this issue May 17, 2023
 * added CI check

Signed-off-by: lns <matzeton@googlemail.com>
utoni added a commit to utoni/nDPI that referenced this issue May 17, 2023
 * added CI check

Signed-off-by: lns <matzeton@googlemail.com>
utoni added a commit to utoni/nDPI that referenced this issue May 19, 2023
 * added CI check

Signed-off-by: lns <matzeton@googlemail.com>
utoni added a commit to utoni/nDPI that referenced this issue May 19, 2023
 * added CI check

Signed-off-by: lns <matzeton@googlemail.com>
utoni added a commit to utoni/nDPI that referenced this issue May 19, 2023
 * added CI check

Signed-off-by: lns <matzeton@googlemail.com>
utoni added a commit to utoni/nDPI that referenced this issue May 19, 2023
 * added CI check

Signed-off-by: lns <matzeton@googlemail.com>
utoni added a commit to utoni/nDPI that referenced this issue May 19, 2023
 * added CI check

Signed-off-by: lns <matzeton@googlemail.com>
utoni added a commit to utoni/nDPI that referenced this issue May 19, 2023
 * added CI check

Signed-off-by: lns <matzeton@googlemail.com>
utoni added a commit to utoni/nDPI that referenced this issue May 19, 2023
 * added CI check

Signed-off-by: lns <matzeton@googlemail.com>
utoni added a commit to utoni/nDPI that referenced this issue May 19, 2023
 * added CI check

Signed-off-by: lns <matzeton@googlemail.com>
utoni added a commit to utoni/nDPI that referenced this issue May 19, 2023
 * added CI check

Signed-off-by: lns <matzeton@googlemail.com>
utoni added a commit to utoni/nDPI that referenced this issue May 19, 2023
 * added CI check

Signed-off-by: lns <matzeton@googlemail.com>
utoni added a commit to utoni/nDPI that referenced this issue May 20, 2023
 * added CI check

Signed-off-by: lns <matzeton@googlemail.com>
utoni added a commit that referenced this issue May 20, 2023
* added CI check

Signed-off-by: lns <matzeton@googlemail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant