RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2144795 - Memory leaks at key build
Summary: Memory leaks at key build
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libssh
Version: 9.2
Hardware: Unspecified
OS: Unspecified
medium
low
Target Milestone: rc
: ---
Assignee: Norbert Pócs
QA Contact: Stanislav Zidek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-11-22 10:33 UTC by Norbert Pócs
Modified: 2023-05-09 10:18 UTC (History)
1 user (show)

Fixed In Version: libssh-0.10.4-6.el9
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-05-09 08:15:49 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker CRYPTO-8825 0 None None None 2022-11-22 10:54:00 UTC
Red Hat Issue Tracker RHELPLAN-140155 0 None None None 2022-11-22 10:54:08 UTC
Red Hat Product Errata RHBA-2023:2476 0 None None None 2023-05-09 08:15:55 UTC

Description Norbert Pócs 2022-11-22 10:33:43 UTC
Description of problem:
Memory leaks were introduced by openssl 3.0 support at key build functions for RSA and DSA.


Version-Release number of selected component (if applicable):
libssh-0.10.4-3.el9


How reproducible:
run test `torture_algorithms` with `valgrind --leak-check=full`

Steps to Reproduce:
1.
2.
3.

Actual results:
==49166== Memcheck, a memory error detector
==49166== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==49166== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==49166== Command: tests/client/torture_algorithms
==49166== 
[==========] Running 59 test(s).
OK: SSH-2.0-OpenSSH_8.8
[ RUN      ] torture_algorithms_aes128_cbc_hmac_sha1
[       OK ] torture_algorithms_aes128_cbc_hmac_sha1
[ RUN      ] torture_algorithms_aes128_cbc_hmac_sha2_256
[       OK ] torture_algorithms_aes128_cbc_hmac_sha2_256
    .
    .
    .
[ RUN      ] torture_algorithms_ecdh_sha2_nistp521
[       OK ] torture_algorithms_ecdh_sha2_nistp521
[==========] 59 test(s) run.
[  PASSED  ] 59 test(s).
[==========] Running 3 test(s).
OK: SSH-2.0-OpenSSH_8.8
OK: SSH-2.0-OpenSSH_8.8
[ RUN      ] torture_algorithms_aes128_gcm_mac
[       OK ] torture_algorithms_aes128_gcm_mac
[ RUN      ] torture_algorithms_aes256_gcm_mac
[       OK ] torture_algorithms_aes256_gcm_mac
[ RUN      ] torture_algorithms_chacha20_poly1305_mac
[       OK ] torture_algorithms_chacha20_poly1305_mac
[==========] 3 test(s) run.
[  PASSED  ] 3 test(s).
==49166== 
==49166== HEAP SUMMARY:
==49166==     in use at exit: 2,856 bytes in 14 blocks
==49166==   total heap usage: 97,087 allocs, 97,073 frees, 63,437,782 bytes allocated
==49166== 
==49166== 560 (48 direct, 512 indirect) bytes in 2 blocks are definitely lost in loss record 2 of 4
==49166==    at 0x484586F: malloc (vg_replace_malloc.c:381)
==49166==    by 0x4A634DC: CRYPTO_zalloc (mem.c:197)
==49166==    by 0x4999652: BN_new (bn_lib.c:247)
==49166==    by 0x466941: ssh_make_string_bn (bignum.c:77)
==49166==    by 0x41BAA8: ssh_buffer_unpack_va (buffer.c:1166)
==49166==    by 0x41C481: _ssh_buffer_unpack (buffer.c:1360)
==49166==    by 0x46356B: ssh_packet_client_dhgex_reply (dh-gex.c:262)
==49166==    by 0x438CE7: ssh_packet_process (packet.c:1494)
==49166==    by 0x43869C: ssh_packet_socket_callback (packet.c:1336)
==49166==    by 0x445EA6: ssh_socket_pollcallback (socket.c:336)
==49166==    by 0x44324D: ssh_poll_ctx_dopoll (poll.c:720)
==49166==    by 0x444C3D: ssh_handle_packets (session.c:665)
==49166== 
==49166== 2,296 (120 direct, 2,176 indirect) bytes in 5 blocks are definitely lost in loss record 4 of 4
==49166==    at 0x484586F: malloc (vg_replace_malloc.c:381)
==49166==    by 0x4A634DC: CRYPTO_zalloc (mem.c:197)
==49166==    by 0x4999652: BN_new (bn_lib.c:247)
==49166==    by 0x466941: ssh_make_string_bn (bignum.c:77)
==49166==    by 0x41BAA8: ssh_buffer_unpack_va (buffer.c:1166)
==49166==    by 0x41C481: _ssh_buffer_unpack (buffer.c:1360)
==49166==    by 0x425270: ssh_packet_client_dh_reply (dh.c:366)
==49166==    by 0x438CE7: ssh_packet_process (packet.c:1494)
==49166==    by 0x43869C: ssh_packet_socket_callback (packet.c:1336)
==49166==    by 0x445EA6: ssh_socket_pollcallback (socket.c:336)
==49166==    by 0x44324D: ssh_poll_ctx_dopoll (poll.c:720)
==49166==    by 0x444C3D: ssh_handle_packets (session.c:665)
==49166== 
==49166== LEAK SUMMARY:
==49166==    definitely lost: 168 bytes in 7 blocks
==49166==    indirectly lost: 2,688 bytes in 7 blocks
==49166==      possibly lost: 0 bytes in 0 blocks
==49166==    still reachable: 0 bytes in 0 blocks
==49166==         suppressed: 0 bytes in 0 blocks
==49166== 
==49166== For lists of detected and suppressed errors, rerun with: -s
==49166== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)



Expected results:
==47406== Memcheck, a memory error detector
==47406== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==47406== Using Valgrind-3.19.0 and LibVEX; rerun with -h for copyright info
==47406== Command: tests/client/torture_algorithms
==47406== 
[==========] Running 59 test(s).
OK: SSH-2.0-OpenSSH_8.8
[ RUN      ] torture_algorithms_aes128_cbc_hmac_sha1
[       OK ] torture_algorithms_aes128_cbc_hmac_sha1
[ RUN      ] torture_algorithms_aes128_cbc_hmac_sha2_256
[       OK ] torture_algorithms_aes128_cbc_hmac_sha2_256
    .
    .
    .
[ RUN      ] torture_algorithms_ecdh_sha2_nistp521
[       OK ] torture_algorithms_ecdh_sha2_nistp521
[==========] 59 test(s) run.
[  PASSED  ] 59 test(s).
[==========] Running 3 test(s).
OK: SSH-2.0-OpenSSH_8.8
OK: SSH-2.0-OpenSSH_8.8
[ RUN      ] torture_algorithms_aes128_gcm_mac
[       OK ] torture_algorithms_aes128_gcm_mac
[ RUN      ] torture_algorithms_aes256_gcm_mac
[       OK ] torture_algorithms_aes256_gcm_mac
[ RUN      ] torture_algorithms_chacha20_poly1305_mac
[       OK ] torture_algorithms_chacha20_poly1305_mac
[==========] 3 test(s) run.
[  PASSED  ] 3 test(s).
==47406== 
==47406== HEAP SUMMARY:
==47406==     in use at exit: 0 bytes in 0 blocks
==47406==   total heap usage: 97,084 allocs, 97,084 frees, 63,435,757 bytes allocated
==47406== 
==47406== All heap blocks were freed -- no leaks are possible
==47406== 
==47406== For lists of detected and suppressed errors, rerun with: -s
==47406== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)


Additional info:

Comment 5 errata-xmlrpc 2023-05-09 08:15:49 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (libssh bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2476


Note You need to log in before you can comment on or make changes to this bug.