From 901da99b6f61da2a2424b79e8dcdebd3a4196107 Mon Sep 17 00:00:00 2001 From: zhangyaqi Date: Fri, 26 Sep 2025 10:40:38 +0800 Subject: [PATCH] backport two patches from upstream (cherry picked from commit c0f6e434416557d53d9d8f641f9e8d79271a7a55) --- 0023-nfsdcld-fix-a-memory-leak.patch | 28 +++++++++++++++++++ ...buffer-overflow-in-get_full_hostname.patch | 28 +++++++++++++++++++ nfs-utils.spec | 7 ++++- 3 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 0023-nfsdcld-fix-a-memory-leak.patch create mode 100644 0024-gssd-fix-the-possible-buffer-overflow-in-get_full_hostname.patch diff --git a/0023-nfsdcld-fix-a-memory-leak.patch b/0023-nfsdcld-fix-a-memory-leak.patch new file mode 100644 index 0000000..93793da --- /dev/null +++ b/0023-nfsdcld-fix-a-memory-leak.patch @@ -0,0 +1,28 @@ +From 211280c0e7d2d11e12124cd64e4e6d169b2f2b88 Mon Sep 17 00:00:00 2001 +From: zhangyaqi +Date: Tue, 6 May 2025 11:23:35 -0400 +Subject: [PATCH] nfsdcld:Fix a memory leak + +Signed-off-by: zhangyaqi +Signed-off-by: Steve Dickson + +Reference:https://git.linux-nfs.org/?p=steved/nfs-utils.git;a=patch;h=211280c0e7d2d11e12124cd64e4e6d169b2f2b88 +--- + utils/nfsdcld/nfsdcld.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/utils/nfsdcld/nfsdcld.c b/utils/nfsdcld/nfsdcld.c +index 636c398..698d3ff 100644 +--- a/utils/nfsdcld/nfsdcld.c ++++ b/utils/nfsdcld/nfsdcld.c +@@ -797,6 +797,7 @@ main(int argc, char **argv) + evbase = event_base_new(); + if (evbase == NULL) { + fprintf(stderr, "%s: unable to allocate event base.\n", argv[0]); ++ free(progname); + return 1; + } + xlog_syslog(0); +-- +2.43.0 + diff --git a/0024-gssd-fix-the-possible-buffer-overflow-in-get_full_hostname.patch b/0024-gssd-fix-the-possible-buffer-overflow-in-get_full_hostname.patch new file mode 100644 index 0000000..fae54c2 --- /dev/null +++ b/0024-gssd-fix-the-possible-buffer-overflow-in-get_full_hostname.patch @@ -0,0 +1,28 @@ +From ff2077d10ad11ad7422d1bb22f5761da6610ca38 Mon Sep 17 00:00:00 2001 +From: zhangyaqi +Date: Tue, 6 May 2025 11:53:59 -0400 +Subject: [PATCH] gssd:fix the possible buffer overflow in get_full_hostname + +Signed-off-by: zhangyaqi +Signed-off-by: Steve Dickson +Reference:https://git.linux-nfs.org/?p=steved/nfs-utils.git;a=patch;h=ff2077d10ad11ad7422d1bb22f5761da6610ca38 + +--- + utils/gssd/krb5_util.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/utils/gssd/krb5_util.c b/utils/gssd/krb5_util.c +index c5f1152..a81f293 100644 +--- a/utils/gssd/krb5_util.c ++++ b/utils/gssd/krb5_util.c +@@ -668,6 +668,7 @@ get_full_hostname(const char *inhost, char *outhost, int outhostlen) + goto out; + } + strncpy(outhost, addrs->ai_canonname, outhostlen); ++ outhost[outhostlen - 1] = '\0'; + nfs_freeaddrinfo(addrs); + for (c = outhost; *c != '\0'; c++) + *c = tolower(*c); +-- +2.43.0 + diff --git a/nfs-utils.spec b/nfs-utils.spec index 836ac97..9c2fa44 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -4,7 +4,7 @@ Name: nfs-utils Version: 2.5.4 -Release: 16 +Release: 17 Epoch: 2 Summary: The Linux NFS userland utility package License: MIT and GPLv2 and GPLv2+ and BSD @@ -35,6 +35,8 @@ 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 +Patch23: 0023-nfsdcld-fix-a-memory-leak.patch +Patch24: 0024-gssd-fix-the-possible-buffer-overflow-in-get_full_hostname.patch BuildRequires: libevent-devel,libcap-devel, libtirpc-devel libblkid-devel BuildRequires: krb5-libs >= 1.4 autoconf >= 2.57 openldap-devel >= 2.2 @@ -303,6 +305,9 @@ fi %{_mandir}/*/* %changelog +* Fri Sep 26 2025 zhangyaqi - 2:2.5.4-17 +- backport bugfix patches from community + * Mon Apr 14 2025 zhangjian - 2:2.5.4-16 - backport bugfix patches from community -- Gitee