backport patches from community

(cherry picked from commit 387433e6b264055ab459a77788d5fc2e0669738d)
This commit is contained in:
foolstrong 2025-04-14 04:07:29 +00:00 committed by openeuler-sync-bot
parent cf9f84058b
commit 3157943385
3 changed files with 73 additions and 1 deletions

View File

@ -0,0 +1,39 @@
From 92995e0d38dc00e930c562cf936220f83c09d082 Mon Sep 17 00:00:00 2001
From: Paulo Andrade <pandrade@redhat.com>
Date: Tue, 23 Jul 2024 12:03:30 -0400
Subject: [PATCH] rpc-gssd.service has status failed (due to rpc.gssd segfault)
Ensure strings are not NULL before doing a strdup() in error path.
Fixes: https://issues.redhat.com/browse/RHEL-43286
Signed-off-by: Steve Dickson <steved@redhat.com>
Reference:https://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commit;h=92995e0d38dc00e930c562cf936220f83c09d082
Conflict:no
---
utils/gssd/gssd.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/utils/gssd/gssd.c b/utils/gssd/gssd.c
index d7a2822..01ce7d1 100644
--- a/utils/gssd/gssd.c
+++ b/utils/gssd/gssd.c
@@ -365,12 +365,12 @@ gssd_read_service_info(int dirfd, struct clnt_info *clp)
fail:
printerr(0, "ERROR: failed to parse %s/info\n", clp->relpath);
- clp->upcall_address = strdup(address);
- clp->upcall_port = strdup(port);
+ clp->upcall_address = address ? strdup(address) : NULL;
+ clp->upcall_port = port ? strdup(port) : NULL;
clp->upcall_program = program;
clp->upcall_vers = version;
- clp->upcall_protoname = strdup(protoname);
- clp->upcall_service = strdup(service);
+ clp->upcall_protoname = protoname ? strdup(protoname) : NULL;
+ clp->upcall_service = service ? strdup(service) : NULL;
free(servername);
free(protoname);
clp->servicename = NULL;
--
1.8.3.1

View File

@ -0,0 +1,28 @@
From 131ec613bab84b7894e428375cc360bb82a336a3 Mon Sep 17 00:00:00 2001
From: Steve Dickson <steved@redhat.com>
Date: Tue, 23 Jul 2024 12:06:28 -0400
Subject: [PATCH] nfsidmap: Fix a memory leak
Reported-by: Zhang Yaqi <zhangyaqi@kylinos.cn>
Signed-off-by: Steve Dickson <steved@redhat.com>
Reference:https://git.linux-nfs.org/?p=steved/nfs-utils.git;a=commit;h=131ec613bab84b7894e428375cc360bb82a336a3
Conflict:no
---
support/nfsidmap/umich_ldap.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/support/nfsidmap/umich_ldap.c b/support/nfsidmap/umich_ldap.c
index 1aa2af4..0f88ba4 100644
--- a/support/nfsidmap/umich_ldap.c
+++ b/support/nfsidmap/umich_ldap.c
@@ -200,6 +200,7 @@ static int set_krb5_ccname(const char *krb5_ccache_name)
IDMAP_LOG(5, ("Failed to set creds cache for kerberos, err(%d)",
retval));
}
+ free(env);
#endif /* else HAVE_GSS_KRB5_CCACHE_NAME */
out:
return retval;
--
1.8.3.1

View File

@ -4,7 +4,7 @@
Name: nfs-utils
Version: 2.5.4
Release: 15
Release: 16
Epoch: 2
Summary: The Linux NFS userland utility package
License: MIT and GPLv2 and GPLv2+ and BSD
@ -33,6 +33,8 @@ Patch17: 0017-Fixed-a-regression-in-the-junction-code.patch
Patch18: 0018-export-fix-handling-of-error-from-match_fsid.patch
Patch19: 0019-export-move-cache_open-before-workers-are-forked.patch
Patch20: 0020-gssd-fix-handling-DNS-lookup-failure.patch
Patch21: 0021-rpc-gssd-service-has-status-failed-due-to-sgefault.patch
Patch22: 0022-nfsidmapd-fix-a-memory-leak.patch
BuildRequires: libevent-devel,libcap-devel, libtirpc-devel libblkid-devel
BuildRequires: krb5-libs >= 1.4 autoconf >= 2.57 openldap-devel >= 2.2
@ -301,6 +303,9 @@ fi
%{_mandir}/*/*
%changelog
* Mon Apr 14 2025 zhangjian <zhangjian496@huawei.com> - 2:2.5.4-16
- backport bugfix patches from community
* Thu Dec 14 2023 wuguanghao <wuguanghao3@huawei.com> - 2:2.5.4-15
- backport bugfix patches from community