!263 [sync] PR-258: 修复KEX交换处理中内存泄露

From: @openeuler-sync-bot 
Reviewed-by: @robertxw 
Signed-off-by: @robertxw
This commit is contained in:
openeuler-ci-bot 2024-02-17 08:53:56 +00:00 committed by Gitee
commit cc91fedee4
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,25 @@
From 7a7862590cbe1f7a9d8957fdc78f324a1bdfc520 Mon Sep 17 00:00:00 2001
From: songjuntao <songjuntao@kylinos.cn>
Date: Fri, 2 Feb 2024 15:55:13 +0800
Subject: [PATCH] fix memory leak in kex exchange function
Signed-off-by: songjuntao <songjuntao@kylinos.cn>
---
sshconnect2.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/sshconnect2.c b/sshconnect2.c
index b6e2197..d3ceee4 100644
--- a/sshconnect2.c
+++ b/sshconnect2.c
@@ -385,6 +385,7 @@ ssh_kex2(struct ssh *ssh, char *host, struct sockaddr *hostaddr, u_short port,
free(prop_kex);
free(prop_enc);
free(prop_hostkey);
+ free(s);
}
/*
--
2.33.0

View File

@ -6,7 +6,7 @@
%{?no_gtk2:%global gtk2 0}
%global sshd_uid 74
%global openssh_release 27
%global openssh_release 28
Name: openssh
Version: 8.8p1
@ -131,6 +131,7 @@ Patch100: backport-fix-CVE-2023-38408-upstream-terminate-process.patch
Patch101: backport-upstream-In-channel_request_remote_forwarding-the-pa.patch
Patch102: backport-CVE-2023-51385-upstream-ban-user-hostnames-with-most-shell-metachar.patch
Patch103: backport-CVE-2023-48795.patch
Patch104: fix-memory-leak-in-kex-exchange.patch
Requires: /sbin/nologin
Requires: libselinux >= 2.3-5 audit-libs >= 1.0.8
@ -312,6 +313,7 @@ popd
%patch101 -p1
%patch102 -p1
%patch103 -p1
%patch104 -p1
autoreconf
pushd pam_ssh_agent_auth-pam_ssh_agent_auth-0.10.4
@ -508,6 +510,12 @@ getent passwd sshd >/dev/null || \
%attr(0644,root,root) %{_mandir}/man8/sftp-server.8*
%changelog
* Fri Feb 2 2024 songjuntao<songjuntao@kylinos.cn> - 8.8p1-28
- Type:bugfix
- CVE:
- SUG:NA
- DESC: fix memory leak in kex2 exchange function
* Wed Jan 31 2024 renmingshuai<renmingshuai@huawei.com> - 8.8p1-27
- Type:bugfix
- CVE: