Repository navigation
two updates - #20
Closed
tim-le wants to merge 4 commits into
Closed
two updates#20tim-le wants to merge 4 commits into
tim-le wants to merge 4 commits into
Conversation
Member
|
Please do not do two different logical changes in the same pull request. Make one for each, it makes it easier to review and handle them independently of each other. |
vszakats
added a commit
to vszakats/libssh2
that referenced
this pull request
Jul 29, 2026
```
=================================================================
==45==ERROR: AddressSanitizer: attempting double-free on 0x7d0048c16680 in thread T0:
SCARINESS: 42 (double-free)
#0 0x564127d3eb66 in free /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:51:3
libssh2#1 0x564127d986bc in ssh2_default_free /src/libssh2/src/session.c:74:5
libssh2#2 0x564127dd403e in ssh2_kex_exchange /src/libssh2/src/kex.c:3735:9
libssh2#3 0x564127df99af in ssh2_packet_add /src/libssh2/src/packet.c:1362:14
libssh2#4 0x564127dadb59 in transport_fullpacket /src/libssh2/src/transport.c:338:14
libssh2#5 0x564127da9b5b in ssh2_transport_read /src/libssh2/src/transport.c:869:18
libssh2#6 0x564127e0034d in ssh2_packet_require /src/libssh2/src/packet.c:1462:15
libssh2#7 0x564127d9a927 in session_startup /src/libssh2/src/session.c:765:14
libssh2#8 0x564127d998bf in libssh2_session_handshake /src/libssh2/src/session.c:813:5
libssh2#9 0x564127d82cda in LLVMFuzzerTestOneInput /src/libssh2/tests/ossfuzz/ssh2_client_fuzzer.cc:64:8
libssh2#10 0x564127c204ad in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:619:13
libssh2#11 0x564127c1fae5 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:516:7
libssh2#12 0x564127c21e22 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile>>&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:834:7
libssh2#13 0x564127c22128 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile>>&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:872:3
libssh2#14 0x564127c10fb5 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:917:6
libssh2#15 0x564127c3cc22 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
libssh2#16 0x7fb049bbb082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 5792732f783158c66fb4f3756458ca24e46e827d)
libssh2#17 0x564127c0430d in _start (build-out/ssh2_client_fuzzer+0x6430d)
DEDUP_TOKEN: __interceptor_free--ssh2_default_free--ssh2_kex_exchange
0x7d0048c16680 is located 0 bytes inside of 491-byte region [0x7d0048c16680,0x7d0048c1686b)
freed by thread T0 here:
#0 0x564127d3eb66 in free /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:51:3
2026-07-26 22:58:44,277 - root - INFO - Fuzzer: ssh2_client_fuzzer. Detected bug.
2026-07-26 22:58:44,277 - root - INFO - Trying to reproduce crash using: /tmp/tmptfcvdhdx/crash-1987022631d6b7820f7f2167f23beb45bca9909b.
libssh2#1 0x564127d986bc in ssh2_default_free /src/libssh2/src/session.c:74:5
libssh2#2 0x564127da7bbf in ssh2_transport_read /src/libssh2/src/transport.c:678:17
libssh2#3 0x564127e0034d in ssh2_packet_require /src/libssh2/src/packet.c:1462:15
libssh2#4 0x564127de7a62 in kex_diffie_hellman_sha /src/libssh2/src/kex.c:555:14
libssh2#5 0x564127deab58 in kex_method_diffie_hellman_group14_key_exchange /src/libssh2/src/kex.c:899:11
libssh2#6 0x564127dea684 in kex_method_diffie_hellman_group14_sha256_key_exchange /src/libssh2/src/kex.c:927:12
libssh2#7 0x564127dd3d0a in ssh2_kex_exchange /src/libssh2/src/kex.c:3719:23
libssh2#8 0x564127df99af in ssh2_packet_add /src/libssh2/src/packet.c:1362:14
libssh2#9 0x564127dadb59 in transport_fullpacket /src/libssh2/src/transport.c:338:14
libssh2#10 0x564127da9b5b in ssh2_transport_read /src/libssh2/src/transport.c:869:18
libssh2#11 0x564127e0034d in ssh2_packet_require /src/libssh2/src/packet.c:1462:15
libssh2#12 0x564127d9a927 in session_startup /src/libssh2/src/session.c:765:14
libssh2#13 0x564127d998bf in libssh2_session_handshake /src/libssh2/src/session.c:813:5
libssh2#14 0x564127d82cda in LLVMFuzzerTestOneInput /src/libssh2/tests/ossfuzz/ssh2_client_fuzzer.cc:64:8
libssh2#15 0x564127c204ad in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:619:13
libssh2#16 0x564127c1fae5 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:516:7
libssh2#17 0x564127c21e22 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile>>&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:834:7
libssh2#18 0x564127c22128 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile>>&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:872:3
libssh2#19 0x564127c10fb5 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:917:6
libssh2#20 0x564127c3cc22 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
libssh2#21 0x7fb049bbb082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 5792732f783158c66fb4f3756458ca24e46e827d)
DEDUP_TOKEN: __interceptor_free--ssh2_default_free--ssh2_transport_read
previously allocated by thread T0 here:
#0 0x564127d3ee04 in malloc /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:67:3
libssh2#1 0x564127d9864c in ssh2_default_alloc /src/libssh2/src/session.c:67:12
libssh2#2 0x564127da7c33 in ssh2_transport_read /src/libssh2/src/transport.c:679:26
libssh2#3 0x564127e0034d in ssh2_packet_require /src/libssh2/src/packet.c:1462:15
libssh2#4 0x564127d9a927 in session_startup /src/libssh2/src/session.c:765:14
libssh2#5 0x564127d998bf in libssh2_session_handshake /src/libssh2/src/session.c:813:5
libssh2#6 0x564127d82cda in LLVMFuzzerTestOneInput /src/libssh2/tests/ossfuzz/ssh2_client_fuzzer.cc:64:8
libssh2#7 0x564127c204ad in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:619:13
libssh2#8 0x564127c1fae5 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool, bool*) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:516:7
libssh2#9 0x564127c21e22 in fuzzer::Fuzzer::ReadAndExecuteSeedCorpora(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile>>&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:834:7
libssh2#10 0x564127c22128 in fuzzer::Fuzzer::Loop(std::__Fuzzer::vector<fuzzer::SizedFile, std::__Fuzzer::allocator<fuzzer::SizedFile>>&) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerLoop.cpp:872:3
libssh2#11 0x564127c10fb5 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:917:6
libssh2#12 0x564127c3cc22 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10
libssh2#13 0x7fb049bbb082 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x24082) (BuildId: 5792732f783158c66fb4f3756458ca24e46e827d)
DEDUP_TOKEN: __interceptor_malloc--ssh2_default_alloc--ssh2_transport_read
SUMMARY: AddressSanitizer: double-free /src/libssh2/src/session.c:74:5 in ssh2_default_free
==45==ABORTING
```
https://github.com/libssh2/libssh2/actions/runs/30224178881/job/89851604319?pr=2398
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
1)added a I/O callback for select
2)support concurrent multiple opening channels, just tested for "direct-tcpip"