Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
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.
Description of problem:
sshd crash for openssh-8.7p1-12 and higher
I also filed an issue here : https://issues.redhat.com/browse/RHEL-321
Version-Release number of selected component (if applicable):
How reproducible:
Steps to Reproduce:
1.install openssh-8.7p1-12 or higher
2.trigger the issue in upstream: fix double-free caused by compat_kex_proposal(); bz3522 - openssh/openssh-portable@12da782 (github.com)
https://github.com/openssh/openssh-portable/commit/12da7823336434a403f25c7cc0c2c6aed0737a35?diff=unified
3.sshd crash due to double free
Actual results:
sshd crash.
Expected results:
no crash.
Additional info:
The issue due to this commit: Fix several memory leaks (585620b0) · Commits · Red Hat / centos-stream / rpms / openssh · GitLab
https://gitlab.com/redhat/centos-stream/rpms/openssh/-/commit/585620b0f1c4cde591c1110e1cb1e7822ee0088b
I try to do a patch and it fixed the issue.
cat openssh-8.7p1-mem-leak2.patch
diff --color -rup a/compat.c b/compat.c
--- a/compat.c 2022-07-14 17:39:23.770268440 +0200
+++ b/compat.c 2023-03-23 17:39:23.770268440 +0200
@@ -191,26 +191,26 @@ compat_pkalg_proposal(struct ssh *ssh, char *pkalg_prop)
char *
compat_kex_proposal(struct ssh *ssh, char *p)
{
- char *cp = NULL;
+ char *cp = NULL, *cp2 = NULL;
if ((ssh->compat & (SSH_BUG_CURVE25519PAD|SSH_OLD_DHGEX)) == 0)
return xstrdup(p);
debug2_f("original KEX proposal: %s", p);
if ((ssh->compat & SSH_BUG_CURVE25519PAD) != 0)
- if ((p = match_filter_denylist(p,
+ if ((cp = match_filter_denylist(p,
"curve25519-sha256")) == NULL)
fatal("match_filter_denylist failed");
if ((ssh->compat & SSH_OLD_DHGEX) != 0) {
- cp = p;
- if ((p = match_filter_denylist(p,
+ if ((cp2 = match_filter_denylist(cp ? cp : p,
"diffie-hellman-group-exchange-sha256,"
"diffie-hellman-group-exchange-sha1")) == NULL)
fatal("match_filter_denylist failed");
free(cp);
+ cp = cp2;
}
- debug2_f("compat KEX proposal: %s", p);
- if (*p == '\0')
+ if (cp == NULL || *cp == '\0')
fatal("No supported key exchange algorithms found");
- return p;
+ debug2_f("compat KEX proposal: %s", cp);
+ return cp;
}
Comment 1Dmitry Belyavskiy
2023-03-27 10:46:48 UTC
Many thanks for your report! We are aware of this problem and tracking it via different issue.
*** This bug has been marked as a duplicate of bug 2173669 ***