Skip to content

Allow authentication keys to be passed in memory. - #5

Closed
calavera wants to merge 4 commits into
libssh2:masterfrom
calavera:userauth_memory
Closed

calavera wants to merge 4 commits into
libssh2:masterfrom
calavera:userauth_memory

Conversation

@calavera

Copy link
Copy Markdown
Contributor

This patch allows to pass ssh keys in memory, without reading files or getting them from an agent. It only works with OpenSSL.

As discussed in the mailing list a few months ago, it would be better to have additional support for libgcrypt before merging this PR, but I don't have the experience necessary to write a good implementation, so I'll leave it as exercise for the reader.

Shout out to Joe Turpin who implemented the patch originally, I just re-applied and cleaned it:
http://www.libssh2.org/mail/libssh2-devel-archive-2012-01/0015.shtml

  • Adds libssh2_userauth_publickey_frommemory macro for libssh2_userauth_publickey_frommemory_ex.
  • Use an unimplemented error for extracting keys from memory with libgcrypt.

All credits go to Joe Turpin, I'm just reaplying and cleaning his patch:
http://www.libssh2.org/mail/libssh2-devel-archive-2012-01/0015.shtml

* Adds libssh2_userauth_publickey_frommemory macro for libssh2_userauth_publickey_frommemory_ex.
* Use an unimplemented error for extracting keys from memory with libgcrypt.
@bagder

bagder commented Mar 12, 2015

Copy link
Copy Markdown
Member

Please make a clear note in the docs about it only working for the OpenSSL backed version.

@calavera

Copy link
Copy Markdown
Contributor Author

Thanks for pointing that out @bagder. I've added a notice in both docs to make it clear.

@alamaison

Copy link
Copy Markdown
Contributor

The patch looks good to me. But can you remove the #defined 'alternative' signature macro (and the _ex suffix on the real signature)? I know the existing API has many of these but we've stopped doing that for new functions.

@calavera

Copy link
Copy Markdown
Contributor Author

Thanks for letting me know @alamaison. I've removed the macro and renamed the function already. I have a doubt though, should I remove the size parameters and check those values inside the function or I should leave it as it is now?

That way the function signature would still be something like:

libssh2_userauth_publickey_frommemory(session, username, publickey, privatekey, passphrase)

@alamaison

Copy link
Copy Markdown
Contributor

Thanks @calavera. Please leave the size parameters. The library shouldn't be calculating sizes on the callers behalf. The callers strings might not even be null terminated

@bagder

bagder commented Mar 13, 2015

Copy link
Copy Markdown
Member

I agree with @alamaison on this and also that's how some of the other functions already work.

@calavera

Copy link
Copy Markdown
Contributor Author

cool, the sizes are still in the parameters list 😄

@alamaison

Copy link
Copy Markdown
Contributor

One last issue: the type of user_len parameter should be size_t, not unsigned int.

@calavera

Copy link
Copy Markdown
Contributor Author

Fixed, thanks again @alamaison!

@alamaison

Copy link
Copy Markdown
Contributor

Thanks. Merged: 18cfec8

@alamaison alamaison closed this Mar 15, 2015
@mback2k

mback2k commented Mar 15, 2015

Copy link
Copy Markdown
Member

This pull request / merge broke the WinCNG build, please take a look at the following autobuilds: https://libssh2build.uxnr.de/waterfall

@calavera

Copy link
Copy Markdown
Contributor Author

Hey @mback2k sorry about that, but thanks for pointing me to the build. I'm not familiar with that code but I can open a new PR to add those functions. Do you think you can point me to some api documentation for LIBCRYPT32? I've not done much windows development but if it can parse the key strings we can have the full feature working there.

@alamaison

Copy link
Copy Markdown
Contributor

@mback2k

mback2k commented Mar 17, 2015

Copy link
Copy Markdown
Member

@calavera No problem. It should be possible to implement it using the existing functionality, like in _libssh2_wincng_pub_priv_keyfile and with _libssh2_wincng_asn_decode_bns. I will give it a try this weekend.
@alamaison Thanks for adding the stub functions. My builds are green again.

@calavera
calavera deleted the userauth_memory branch March 17, 2015 15:39
@mback2k

mback2k commented Mar 22, 2015

Copy link
Copy Markdown
Member

@calavera I just implemented this feature for WinCNG in 71d45d3. Would you mind giving it a try?

@ghost ghost mentioned this pull request Apr 18, 2016
tiennou added a commit to tiennou/libssh2 that referenced this pull request Jul 4, 2019
Caught by ASAN:

=================================================================
==73797==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60700001bcf0 at pc 0x00010026198d bp 0x7ffeefbfed30 sp 0x7ffeefbfe4d8
READ of size 69 at 0x60700001bcf0 thread T0
2019-07-04 08:35:30.292502+0200 atos[73890:2639175] examining /Users/USER/*/libssh2_clar [73797]
    #0 0x10026198c in wrap_memchr (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1f98c)
    #1 0x1000f8e66 in file_read_publickey userauth.c:633
    #2 0x1000f2dc9 in userauth_publickey_fromfile userauth.c:1513
    libssh2#3 0x1000f2948 in libssh2_userauth_publickey_fromfile_ex userauth.c:1590
    libssh2#4 0x10000e254 in test_userauth_publickey__ed25519_auth_ok publickey.c:69
    libssh2#5 0x1000090c3 in clar_run_test clar.c:260
    libssh2#6 0x1000038f3 in clar_run_suite clar.c:343
    libssh2#7 0x100003272 in clar_test_run clar.c:522
    libssh2#8 0x10000c3cc in main runner.c:60
    libssh2#9 0x7fff5b43b3d4 in start (libdyld.dylib:x86_64+0x163d4)

0x60700001bcf0 is located 0 bytes to the right of 80-byte region [0x60700001bca0,0x60700001bcf0)
allocated by thread T0 here:
    #0 0x10029e053 in wrap_malloc (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x5c053)
    #1 0x1000b4978 in libssh2_default_alloc session.c:67
    #2 0x1000f8aba in file_read_publickey userauth.c:597
    libssh2#3 0x1000f2dc9 in userauth_publickey_fromfile userauth.c:1513
    libssh2#4 0x1000f2948 in libssh2_userauth_publickey_fromfile_ex userauth.c:1590
    libssh2#5 0x10000e254 in test_userauth_publickey__ed25519_auth_ok publickey.c:69
    libssh2#6 0x1000090c3 in clar_run_test clar.c:260
    libssh2#7 0x1000038f3 in clar_run_suite clar.c:343
    libssh2#8 0x100003272 in clar_test_run clar.c:522
    libssh2#9 0x10000c3cc in main runner.c:60
    libssh2#10 0x7fff5b43b3d4 in start (libdyld.dylib:x86_64+0x163d4)

SUMMARY: AddressSanitizer: heap-buffer-overflow (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1f98c) in wrap_memchr
Shadow bytes around the buggy address:
  0x1c0e00003740: fd fd fd fd fd fd fd fd fd fd fa fa fa fa fd fd
  0x1c0e00003750: fd fd fd fd fd fd fd fa fa fa fa fa 00 00 00 00
  0x1c0e00003760: 00 00 00 00 00 00 fa fa fa fa 00 00 00 00 00 00
  0x1c0e00003770: 00 00 00 fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x1c0e00003780: fd fd fa fa fa fa fd fd fd fd fd fd fd fd fd fa
=>0x1c0e00003790: fa fa fa fa 00 00 00 00 00 00 00 00 00 00[fa]fa
  0x1c0e000037a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0e000037b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0e000037c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0e000037d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0e000037e0: 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
  Shadow gap:              cc
willco007 pushed a commit that referenced this pull request Jul 15, 2019
…386)

File: userauth.c

Credit: 
Etienne Samson

Notes: 
Caught by ASAN:

=================================================================
==73797==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60700001bcf0 at pc 0x00010026198d bp 0x7ffeefbfed30 sp 0x7ffeefbfe4d8
READ of size 69 at 0x60700001bcf0 thread T0
2019-07-04 08:35:30.292502+0200 atos[73890:2639175] examining /Users/USER/*/libssh2_clar [73797]
    #0 0x10026198c in wrap_memchr (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1f98c)
    #1 0x1000f8e66 in file_read_publickey userauth.c:633
    #2 0x1000f2dc9 in userauth_publickey_fromfile userauth.c:1513
    #3 0x1000f2948 in libssh2_userauth_publickey_fromfile_ex userauth.c:1590
    #4 0x10000e254 in test_userauth_publickey__ed25519_auth_ok publickey.c:69
    #5 0x1000090c3 in clar_run_test clar.c:260
    #6 0x1000038f3 in clar_run_suite clar.c:343
    #7 0x100003272 in clar_test_run clar.c:522
    #8 0x10000c3cc in main runner.c:60
    #9 0x7fff5b43b3d4 in start (libdyld.dylib:x86_64+0x163d4)

0x60700001bcf0 is located 0 bytes to the right of 80-byte region [0x60700001bca0,0x60700001bcf0)
allocated by thread T0 here:
    #0 0x10029e053 in wrap_malloc (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x5c053)
    #1 0x1000b4978 in libssh2_default_alloc session.c:67
    #2 0x1000f8aba in file_read_publickey userauth.c:597
    #3 0x1000f2dc9 in userauth_publickey_fromfile userauth.c:1513
    #4 0x1000f2948 in libssh2_userauth_publickey_fromfile_ex userauth.c:1590
    #5 0x10000e254 in test_userauth_publickey__ed25519_auth_ok publickey.c:69
    #6 0x1000090c3 in clar_run_test clar.c:260
    #7 0x1000038f3 in clar_run_suite clar.c:343
    #8 0x100003272 in clar_test_run clar.c:522
    #9 0x10000c3cc in main runner.c:60
    #10 0x7fff5b43b3d4 in start (libdyld.dylib:x86_64+0x163d4)

SUMMARY: AddressSanitizer: heap-buffer-overflow (libclang_rt.asan_osx_dynamic.dylib:x86_64h+0x1f98c) in wrap_memchr
Shadow bytes around the buggy address:
  0x1c0e00003740: fd fd fd fd fd fd fd fd fd fd fa fa fa fa fd fd
  0x1c0e00003750: fd fd fd fd fd fd fd fa fa fa fa fa 00 00 00 00
  0x1c0e00003760: 00 00 00 00 00 00 fa fa fa fa 00 00 00 00 00 00
  0x1c0e00003770: 00 00 00 fa fa fa fa fa fd fd fd fd fd fd fd fd
  0x1c0e00003780: fd fd fa fa fa fa fd fd fd fd fd fd fd fd fd fa
=>0x1c0e00003790: fa fa fa fa 00 00 00 00 00 00 00 00 00 00[fa]fa
  0x1c0e000037a0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0e000037b0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0e000037c0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0e000037d0: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
  0x1c0e000037e0: 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
  Shadow gap:              cc
vszakats added a commit to vszakats/libssh2 that referenced this pull request Jul 25, 2026
```
Direct leak of 395 byte(s) in 1 object(s) allocated from:
    #0 0x56485558fe04 in malloc /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:67:3
    libssh2#1 0x5648555e8fbc in ssh2_default_alloc /src/libssh2/src/session.c:67:12
    libssh2#2 0x5648555f849d in ssh2_transport_read /src/libssh2/src/transport.c:677:26
    libssh2#3 0x56485565138b in ssh2_packet_burn /src/libssh2/src/packet.c:1534:15
    libssh2#4 0x56485563802d in kex_diffie_hellman_sha /src/libssh2/src/kex.c:537:25
    libssh2#5 0x56485563b3f8 in kex_method_diffie_hellman_group14_key_exchange /src/libssh2/src/kex.c:905:11
    libssh2#6 0x56485563af24 in kex_method_diffie_hellman_group14_sha256_key_exchange /src/libssh2/src/kex.c:933:12
    libssh2#7 0x56485562458a in ssh2_kex_exchange /src/libssh2/src/kex.c:3741:23
```
Ref: https://github.com/libssh2/libssh2/actions/runs/29953989502/job/89038339664#step:5:53
vszakats added a commit to vszakats/libssh2 that referenced this pull request Jul 26, 2026
```
Direct leak of 395 byte(s) in 1 object(s) allocated from:
    #0 0x56485558fe04 in malloc /src/llvm-project/compiler-rt/lib/asan/asan_malloc_linux.cpp:67:3
    libssh2#1 0x5648555e8fbc in ssh2_default_alloc /src/libssh2/src/session.c:67:12
    libssh2#2 0x5648555f849d in ssh2_transport_read /src/libssh2/src/transport.c:677:26
    libssh2#3 0x56485565138b in ssh2_packet_burn /src/libssh2/src/packet.c:1534:15
    libssh2#4 0x56485563802d in kex_diffie_hellman_sha /src/libssh2/src/kex.c:537:25
    libssh2#5 0x56485563b3f8 in kex_method_diffie_hellman_group14_key_exchange /src/libssh2/src/kex.c:905:11
    libssh2#6 0x56485563af24 in kex_method_diffie_hellman_group14_sha256_key_exchange /src/libssh2/src/kex.c:933:12
    libssh2#7 0x56485562458a in ssh2_kex_exchange /src/libssh2/src/kex.c:3741:23
```
Ref: https://github.com/libssh2/libssh2/actions/runs/29953989502/job/89038339664#step:5:53
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants