diff --git a/0008-nfsidmap-Fix-a-memory-leak.patch b/0008-nfsidmap-Fix-a-memory-leak.patch new file mode 100644 index 0000000000000000000000000000000000000000..bab50a988327f6a29649bc75fed6cb18728a6741 --- /dev/null +++ b/0008-nfsidmap-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=patch;h=131ec613bab84b7894e428375cc360bb82a336a3 +--- + 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 c475d37..ac2c960 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; +-- +2.27.0 + diff --git a/0009-rpcdebug-fix-memory-allocation-size.patch b/0009-rpcdebug-fix-memory-allocation-size.patch new file mode 100644 index 0000000000000000000000000000000000000000..cfe7958aded091565cc65198782b10c89d724cdc --- /dev/null +++ b/0009-rpcdebug-fix-memory-allocation-size.patch @@ -0,0 +1,56 @@ +From bdf9a974fce8b12da6d65b47841b3ced2da4868d Mon Sep 17 00:00:00 2001 +From: Olga Kornievskaia +Date: Fri, 16 Aug 2024 09:46:33 -0400 +Subject: [PATCH] rpcdebug: fix memory allocation size + +Memory isn't allocated enough to hold the null terminator. + +Valgring complains about invalid memory access: + +[aglo@localhost rpcdebug]$ valgrind ./rpcdebug +==222602== Memcheck, a memory error detector +==222602== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al. +==222602== Using Valgrind-3.23.0 and LibVEX; rerun with -h for copyright info +==222602== Command: ./rpcdebug +==222602== +==222602== Invalid write of size 1 +==222602== at 0x4871218: strcpy (vg_replace_strmem.c:564) +==222602== by 0x400CA3: main (rpcdebug.c:62) +==222602== Address 0x4a89048 is 0 bytes after a block of size 8 alloc'd +==222602== at 0x4868388: malloc (vg_replace_malloc.c:446) +==222602== by 0x400C77: main (rpcdebug.c:57) +==222602== +==222602== Invalid read of size 1 +==222602== at 0x48710E4: __GI_strlen (vg_replace_strmem.c:506) +==222602== by 0x492FA7F: __vfprintf_internal (vfprintf-internal.c:1647) +==222602== by 0x49302F3: buffered_vfprintf (vfprintf-internal.c:2296) +==222602== by 0x492F21F: __vfprintf_internal (vfprintf-internal.c:1377) +==222602== by 0x491BC93: fprintf (fprintf.c:32) +==222602== by 0x40103F: main (rpcdebug.c:100) +==222602== Address 0x4a89048 is 0 bytes after a block of size 8 alloc'd +==222602== at 0x4868388: malloc (vg_replace_malloc.c:446) + +Signed-off-by: Olga Kornievskaia +Signed-off-by: Steve Dickson +Reference:https://git.linux-nfs.org/?p=steved/nfs-utils.git;a=patch;h=bdf9a974fce8b12da6d65b47841b3ced2da4868d + +--- + tools/rpcdebug/rpcdebug.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/rpcdebug/rpcdebug.c b/tools/rpcdebug/rpcdebug.c +index 68206cc..d76cbd1 100644 +--- a/tools/rpcdebug/rpcdebug.c ++++ b/tools/rpcdebug/rpcdebug.c +@@ -54,7 +54,7 @@ main(int argc, char **argv) + char * module = NULL; + int c; + +- cdename = malloc(strlen(basename(argv[0]))); ++ cdename = malloc(strlen(basename(argv[0])) + 1); + if (cdename == NULL) { + fprintf(stderr, "failed in malloc\n"); + exit(1); +-- +2.27.0 + diff --git a/nfs-utils.spec b/nfs-utils.spec index 99c30ebfad7fa9584d943892a9632980c1e0fa35..1e2639aa13146af42c9099e59958dbd21c90e645 100644 --- a/nfs-utils.spec +++ b/nfs-utils.spec @@ -4,7 +4,7 @@ Name: nfs-utils Version: 2.5.1 -Release: 10 +Release: 11 Epoch: 1 Summary: The Linux NFS userland utility package License: MIT and GPLv2 and GPLv2+ and BSD @@ -20,6 +20,8 @@ Patch4: 0004-nfs-blkmaped-Fix-the-error-status-when-nfs_blkmapd-s.patch Patch5: 0005-nfs-blkmapd-PID-file-read-by-systemd-failed.patch Patch6: 0006-gssd-fix-the-possible-buffer-overflow-in-get_full_hostname.patch Patch7: 0007-exportfs-fix-unexporting-of-root.patch +Patch8: 0008-nfsidmap-Fix-a-memory-leak.patch +Patch9: 0009-rpcdebug-fix-memory-allocation-size.patch BuildRequires: libevent-devel,libcap-devel, libtirpc-devel libblkid-devel BuildRequires: krb5-libs >= 1.4 autoconf >= 2.57 openldap-devel >= 2.2 @@ -228,6 +230,9 @@ fi %{_mandir}/*/* %changelog +* Mon Sep 29 2025 zhangyaqi - 1:2.5.1-11 +- backport two patches from upstream + * Sun Sep 28 2025 zhangyaqi - 1:2.5.1-10 - exportfs: fix unexporting of '/'