From e1c2d57deb88f7da4d338449414168d36be95a39 Mon Sep 17 00:00:00 2001 From: zhangjian Date: Tue, 26 Aug 2025 01:21:42 +0000 Subject: [PATCH] backport two patches from upstream (cherry picked from commit ceb4c09bae6cd7549f008930ffc49f52365b4bf6) --- 0010-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 0010-nfsdcld-fix-a-memory-leak.patch create mode 100644 0011-gssd-fix-the-possible-buffer-overflow-in-get_full_hostname.patch diff --git a/0010-nfsdcld-fix-a-memory-leak.patch b/0010-nfsdcld-fix-a-memory-leak.patch new file mode 100644 index 0000000..0618f36 --- /dev/null +++ b/0010-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 +Conflict:no +--- + utils/nfsdcld/nfsdcld.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/utils/nfsdcld/nfsdcld.c b/utils/nfsdcld/nfsdcld.c +index f7737d9..8551dc9 100644 +--- a/utils/nfsdcld/nfsdcld.c ++++ b/utils/nfsdcld/nfsdcld.c +@@ -822,6 +822,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); +-- +1.8.3.1 diff --git a/0011-gssd-fix-the-possible-buffer-overflow-in-get_full_hostname.patch b/0011-gssd-fix-the-possible-buffer-overflow-in-get_full_hostname.patch new file mode 100644 index 0000000..851df17 --- /dev/null +++ b/0011-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 +Conflict:no +--- + 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 560e8be..09625fb 100644 +--- a/utils/gssd/krb5_util.c ++++ b/utils/gssd/krb5_util.c +@@ -619,6 +619,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); +-- +1.8.3.1 \ No newline at end of file diff --git a/nfs-utils.spec b/nfs-utils.spec index 9373b86..d024c57 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -4,7 +4,7 @@ Name: nfs-utils Version: 2.6.3 -Release: 3 +Release: 4 Epoch: 2 Summary: The Linux NFS userland utility package License: MIT and GPLv2 and GPLv2+ and BSD @@ -22,6 +22,8 @@ Patch6: 0006-nfsidmap-fix-a-memory-leak.patch 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-nfsdcld-fix-a-memory-leak.patch +Patch11: 0011-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 @@ -294,6 +296,9 @@ fi %{_mandir}/*/* %changelog +* Tue Aug 26 2025 zhangjian - 2:2.6.3-4 +- backport two patches from upstream + * Mon Nov 18 2024 zhangjian - 2:2.6.3-3 - backport bugfix patches from community -- Gitee