public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/nfs-utils] f43: Add a couple upstream fixes
@ 2026-05-31 12:17 Steve Dickson
  0 siblings, 0 replies; only message in thread
From: Steve Dickson @ 2026-05-31 12:17 UTC (permalink / raw)
  To: git-commits

            A new commit has been pushed.

            Repo   : rpms/nfs-utils
            Branch : f43
            Commit : 32ea64f2c23d34136b25fc0bf2824c03757c2332
            Author : Steve Dickson <steved@redhat.com>
            Date   : 2026-05-30T17:25:34-04:00
            Stats  : +79/-1 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/nfs-utils/c/32ea64f2c23d34136b25fc0bf2824c03757c2332?branch=f43

            Log:
            Add a couple upstream fixes

- libnfsidmap: avoid malloc(0) for empty Local-Realms
- Removed warnings in nfs_sockaddr2universal()

Signed-off-by: Steve Dickson <steved@redhat.com>

---
diff --git a/nfs-utils-2.8.7-getport-warning.patch b/nfs-utils-2.8.7-getport-warning.patch
new file mode 100644
index 0000000..d85907f
--- /dev/null
+++ b/nfs-utils-2.8.7-getport-warning.patch
@@ -0,0 +1,33 @@
+commit a94929b05c9c40d6dc6e3a84d16e4d73d7368ea0
+Author: Steve Dickson <steved@redhat.com>
+Date:   Thu May 28 15:13:36 2026 -0400
+
+    Removed warnings in nfs_sockaddr2universal()
+    
+    in function 'nfs_sockaddr2universal',
+        inlined from 'nsm_xmit_getaddr.constprop' at ../../support/nsm/rpc.c:251:17:
+    ../../support/nfs/getport.c:459:24: warning: 'strndup' specified bound 108 exceeds source size 26 [-Wstringop-overread]
+      459 |                 return strndup(sun->sun_path, sizeof(sun->sun_path));
+          |                        ^
+    
+    Signed-off-by: Steve Dickson <steved@redhat.com>
+
+diff --git a/support/nfs/getport.c b/support/nfs/getport.c
+index 813f7bf9..608e185b 100644
+--- a/support/nfs/getport.c
++++ b/support/nfs/getport.c
+@@ -452,11 +452,12 @@ char *nfs_sockaddr2universal(const struct sockaddr *sap)
+ 	uint16_t port;
+ 	size_t count;
+ 	char *result;
+-	int len;
++	int len = sizeof(struct sockaddr);
+ 
+ 	switch (sap->sa_family) {
+ 	case AF_LOCAL:
+-		return strndup(sun->sun_path, sizeof(sun->sun_path));
++		size_t path_len = len - offsetof(struct sockaddr_un, sun_path);
++		return strndup(sun->sun_path, path_len);
+ 	case AF_INET:
+ 		if (inet_ntop(AF_INET, (const void *)&sin->sin_addr.s_addr,
+ 					buf, (socklen_t)sizeof(buf)) == NULL)

diff --git a/nfs-utils-2.8.7-libnfsidmap-empty-realms.patch b/nfs-utils-2.8.7-libnfsidmap-empty-realms.patch
new file mode 100644
index 0000000..32b0653
--- /dev/null
+++ b/nfs-utils-2.8.7-libnfsidmap-empty-realms.patch
@@ -0,0 +1,39 @@
+commit fcd3161b98f8ff2964e3e275ad1c9977a37303f1
+Author: xuchenchen <xuchenchen@kylinos.cn>
+Date:   Thu May 28 11:11:28 2026 -0400
+
+    libnfsidmap: avoid malloc(0) for empty Local-Realms
+    
+    conf_get_list() can return an empty list when Local-Realms is present
+    but contains only empty fields, such as ", ,". In that case the Realms
+    list logging path computes a buffer size of zero and then writes a NUL
+    byte to the result of malloc(0).
+    
+    Reserve space for the terminating NUL byte and use calloc() so the log
+    buffer is valid even when the realm list is empty.
+    
+    Signed-off-by: xuchenchen <xuchenchen@kylinos.cn>
+    Signed-off-by: Steve Dickson <steved@redhat.com>
+
+diff --git a/support/nfsidmap/libnfsidmap.c b/support/nfsidmap/libnfsidmap.c
+index e1475879..5377a0ee 100644
+--- a/support/nfsidmap/libnfsidmap.c
++++ b/support/nfsidmap/libnfsidmap.c
+@@ -409,15 +409,14 @@ int nfs4_init_name_mapping(char *conffile)
+ 	if (idmap_verbosity >= 1) {
+ 		struct conf_list_node *r;
+ 		char *buf = NULL;
+-		int siz=0;
++		size_t siz = 1;
+ 
+ 		if (local_realms) {
+ 			TAILQ_FOREACH(r, &local_realms->fields, link) {
+ 				siz += (strlen(r->field)+4);
+ 			}
+-			buf = malloc(siz);
++			buf = calloc(1, siz);
+ 			if (buf) {
+-				*buf = 0;
+ 				TAILQ_FOREACH(r, &local_realms->fields, link) {
+ 					sprintf(buf+strlen(buf), "'%s' ", r->field);
+ 				}

diff --git a/nfs-utils.spec b/nfs-utils.spec
index 1311293..4451fd8 100644
--- a/nfs-utils.spec
+++ b/nfs-utils.spec
@@ -2,7 +2,7 @@ Summary: NFS utilities and supporting clients and daemons for the kernel NFS ser
 Name: nfs-utils
 URL: http://linux-nfs.org/
 Version: 2.8.7
-Release: 2%{?dist}
+Release: 3%{?dist}
 Epoch: 1
 
 # group all 32bit related archs
@@ -16,6 +16,8 @@ Source4: 10-nfsv4.conf
 
 Patch001: nfs-utils-2.8.7-nfsdctl-no-listeners.patch
 Patch002: nfs-utils-2.9.1-nfs-iostat-display-MBs.patch
+Patch003: nfs-utils-2.8.7-libnfsidmap-empty-realms.patch
+Patch004: nfs-utils-2.8.7-getport-warning.patch
 
 Patch100: nfs-utils-1.2.1-statdpath-man.patch
 Patch102: nfs-utils-1.2.5-idmap-errmsg.patch
@@ -450,6 +452,10 @@ rm -rf /etc/systemd/system/rpc-*.requires
 %{_mandir}/*/nfsiostat.8.gz
 
 %changelog
+* Sat May 30 2026 Steve Dickson <steved@redhat.com> 2.8.7-3
+- libnfsidmap: avoid malloc(0) for empty Local-Realms
+- Removed warnings in nfs_sockaddr2universal()
+
 * Wed May  6 2026 Steve Dickson <steved@redhat.com> 2.8.7-2
 - nfs-iostat: add option to display throughput in MB/s
 

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-31 12:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-31 12:17 [rpms/nfs-utils] f43: Add a couple upstream fixes Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox