From 88ce8312fc4415452e43d2deca3899649ee1a7b0 Mon Sep 17 00:00:00 2001 From: zhangyaqi Date: Fri, 26 Sep 2025 13:48:05 +0800 Subject: [PATCH] backport two patches from upstream (cherry picked from commit dec7710bf07beafc1a912729822c75dd55169bf5) --- 0011-nfsdcld-fix-a-memory-leak.patch | 28 +++++++++++++++++++ ...buffer-overflow-in-get_full_hostname.patch | 27 ++++++++++++++++++ nfs-utils.spec | 7 ++++- 3 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 0011-nfsdcld-fix-a-memory-leak.patch create mode 100644 0012-gssd-fix-the-possible-buffer-overflow-in-get_full_hostname.patch diff --git a/0011-nfsdcld-fix-a-memory-leak.patch b/0011-nfsdcld-fix-a-memory-leak.patch new file mode 100644 index 0000000..99a7d91 --- /dev/null +++ b/0011-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 dbc7a57..133c7cd 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/0012-gssd-fix-the-possible-buffer-overflow-in-get_full_hostname.patch b/0012-gssd-fix-the-possible-buffer-overflow-in-get_full_hostname.patch new file mode 100644 index 0000000..22757d3 --- /dev/null +++ b/0012-gssd-fix-the-possible-buffer-overflow-in-get_full_hostname.patch @@ -0,0 +1,27 @@ +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 e3f270e..6f855fb 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 004d913..bacdfd7 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -4,7 +4,7 @@ Name: nfs-utils Version: 2.6.3 -Release: 4 +Release: 5 Epoch: 2 Summary: The Linux NFS userland utility package License: MIT and GPLv2 and GPLv2+ and BSD @@ -23,6 +23,8 @@ Patch7: 0007-rpc-gssd-service-has-status-failed-due-to-segfault.patch Patch8: 0008-fixed-a-regression-in-the-junction-code.patch Patch9: 0009-libnfsidmap-try-to-get-the-domain-directly-from-host.patch Patch10: 0010-allow-mount.nfs-to-be-writeable-by-owner.patch +Patch11: 0011-nfsdcld-fix-a-memory-leak.patch +Patch12: 0012-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 @@ -289,6 +291,9 @@ fi %{_mandir}/*/* %changelog +* Fri Sep 26 2025 zhangyaqi - 2:2.6.3-5 +- backport two patches from upstream + * Tue Mar 11 2025 Funda Wang - 2:2.6.3-4 - fix permission of mount.nfs -- Gitee