From 3157943385daf1799d80d09933f8fa88239ca6ec Mon Sep 17 00:00:00 2001 From: foolstrong Date: Mon, 14 Apr 2025 04:07:29 +0000 Subject: [PATCH] backport patches from community (cherry picked from commit 387433e6b264055ab459a77788d5fc2e0669738d) --- ...ce-has-status-failed-due-to-sgefault.patch | 39 +++++++++++++++++++ 0022-nfsidmapd-fix-a-memory-leak.patch | 28 +++++++++++++ nfs-utils.spec | 7 +++- 3 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 0021-rpc-gssd-service-has-status-failed-due-to-sgefault.patch create mode 100644 0022-nfsidmapd-fix-a-memory-leak.patch diff --git a/0021-rpc-gssd-service-has-status-failed-due-to-sgefault.patch b/0021-rpc-gssd-service-has-status-failed-due-to-sgefault.patch new file mode 100644 index 0000000..06a2578 --- /dev/null +++ b/0021-rpc-gssd-service-has-status-failed-due-to-sgefault.patch @@ -0,0 +1,39 @@ +From 92995e0d38dc00e930c562cf936220f83c09d082 Mon Sep 17 00:00:00 2001 +From: Paulo Andrade +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 + +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 \ No newline at end of file diff --git a/0022-nfsidmapd-fix-a-memory-leak.patch b/0022-nfsidmapd-fix-a-memory-leak.patch new file mode 100644 index 0000000..4004a70 --- /dev/null +++ b/0022-nfsidmapd-fix-a-memory-leak.patch @@ -0,0 +1,28 @@ +From 131ec613bab84b7894e428375cc360bb82a336a3 Mon Sep 17 00:00:00 2001 +From: Steve Dickson +Date: Tue, 23 Jul 2024 12:06:28 -0400 +Subject: [PATCH] nfsidmap: Fix a memory leak + +Reported-by: Zhang Yaqi +Signed-off-by: Steve Dickson + +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 \ No newline at end of file diff --git a/nfs-utils.spec b/nfs-utils.spec index 9e46a10..836ac97 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -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 - 2:2.5.4-16 +- backport bugfix patches from community + * Thu Dec 14 2023 wuguanghao - 2:2.5.4-15 - backport bugfix patches from community -- Gitee