View Issue Details

IDProjectCategoryView StatusLast Update
0015895CentOS-7nfs-utilspublic2019-03-07 16:54
Reporterptrrkssn 
PrioritynormalSeveritycrashReproducibilityrandom
Status newResolutionopen 
Platformx86_64OSCentOSOS Version7
Product Version7.6.1810 
Target VersionFixed in Version 
Summary0015895: rpc.gssd core-dumps due to strcmp() of NULL pointer
DescriptionWe have a CentOS-based systems-testing server that once every minute NFS-mounts remote shares from our file servers using NFSv4 and sec=krb5 in order to measure the response time (and uptime). We've noticed that after a while (a couple of hours) sometimes "rpc.gssd" core-dumps.

It seems rpc.gssd crashes due to the "clp->protocol" struct member sometimes is set to NULL so the strcmp() comparision of "tcp" in gssd_proc.c: create_auth_rpc_client() fails badly.

The same issue is present in nfs-utils 1.3.4 and 2.3.3. Even though they removed the check for "tcp" in 1.3.4/2.3.3 it still fails when checking for "udp"...

I made a simple fix that checks if clp->protocol is NULL before calling strcmp() and now the rpc.gssd daemon has been running smoothly since last week.

       protocol = IPPROTO_TCP;
        if (clp->protocol && (strcmp(clp->protocol, "udp")) == 0)
                protocol = IPPROTO_UDP;
(Code from nfs-utils 1.3.4 & 2.3.3, the code in 1.3.0 looks sligthly different but it should be obvious)

I noticed that some other people have notice that gssproxy has been know to trigger this (or similar) behaviour, we are running gssproxy.
Steps To ReproduceRun a script that every minute does something like this:

kinit <user>@<realm>
for H in server1 server2 server3 server4 server5 server6 server7 server8; do
  mount -t nfs -o vers=4.1,sec=krb5 $H:/some/path /mnt/$H && umount /mnt/$H &
done
wait

and then wait some hours...
TagsNo tags attached.
abrt_hash
URL

Activities

ptrrkssn

ptrrkssn

2019-03-07 15:43

reporter   ~0033959

Please find enclosed a (very) simple patch that fixes the issue for nfs-utils-2.3.3 ....

nfs-utils-2.3.3-liu.patch (758 bytes)
diff -r -u nfs-utils-2.3.3/utils/gssd/gssd_proc.c nfs-utils-2.3.3-liu/utils/gssd/gssd_proc.c
--- nfs-utils-2.3.3/utils/gssd/gssd_proc.c	2018-09-06 20:09:08.000000000 +0200
+++ nfs-utils-2.3.3-liu/utils/gssd/gssd_proc.c	2019-03-01 21:07:42.580105572 +0100
@@ -345,11 +345,12 @@
 
 	/* create an rpc connection to the nfs server */
 
-	printerr(2, "creating %s client for server %s\n", clp->protocol,
-			clp->servername);
+	printerr(2, "creating %s client for server %s\n", 
+		 clp->protocol ? clp->protocol : "<null>",
+		 clp->servername ? clp->servername : "<null>");
 
 	protocol = IPPROTO_TCP;
-	if ((strcmp(clp->protocol, "udp")) == 0)
+	if (clp->protocol && strcmp(clp->protocol, "udp") == 0)
 		protocol = IPPROTO_UDP;
 
 	switch (addr->sa_family) {
ptrrkssn

ptrrkssn

2019-03-07 15:48

reporter   ~0033960

Please find enclosed two patches that fixes the same issue for the old versions of nfs-utils - 1.3.0 and 1.3.4

nfs-utils-1.3.0-liu.patch (1,013 bytes)
diff -u -r nfs-utils-1.3.0/utils/gssd/gssd_proc.c nfs-utils-1.3.0-liu/utils/gssd/gssd_proc.c
--- nfs-utils-1.3.0/utils/gssd/gssd_proc.c	2014-03-25 16:12:07.000000000 +0100
+++ nfs-utils-1.3.0-liu/utils/gssd/gssd_proc.c	2019-03-07 16:45:17.776417634 +0100
@@ -878,12 +878,13 @@
 
 	/* create an rpc connection to the nfs server */
 
-	printerr(2, "creating %s client for server %s\n", clp->protocol,
-			clp->servername);
+	printerr(2, "creating %s client for server %s\n", 
+                 clp->protocol ? clp->protocol : "<null>",
+                 clp->servername ? clp->servername : "<null>");
 
-	if ((strcmp(clp->protocol, "tcp")) == 0) {
+	if (clp->protocol && (strcmp(clp->protocol, "tcp")) == 0) {
 		protocol = IPPROTO_TCP;
-	} else if ((strcmp(clp->protocol, "udp")) == 0) {
+	} else if (clp->protocol && (strcmp(clp->protocol, "udp")) == 0) {
 		protocol = IPPROTO_UDP;
 	} else {
 		printerr(0, "WARNING: unrecognized protocol, '%s', requested "
Only in nfs-utils-1.3.0-liu/utils/gssd: gssd_proc.c~
nfs-utils-1.3.4-liu.patch (841 bytes)
diff -u -r nfs-utils-1.3.4/utils/gssd/gssd_proc.c nfs-utils-1.3.4-liu/utils/gssd/gssd_proc.c
--- nfs-utils-1.3.4/utils/gssd/gssd_proc.c	2016-08-03 20:25:15.000000000 +0200
+++ nfs-utils-1.3.4-liu/utils/gssd/gssd_proc.c	2019-03-07 16:47:31.388471317 +0100
@@ -345,11 +345,12 @@
 
 	/* create an rpc connection to the nfs server */
 
-	printerr(2, "creating %s client for server %s\n", clp->protocol,
-			clp->servername);
+	printerr(2, "creating %s client for server %s\n", 
+                 clp->protocol ? clp->protocol : "<null>",
+                 clp->servername ? clp->servername : "<null>");
 
 	protocol = IPPROTO_TCP;
-	if ((strcmp(clp->protocol, "udp")) == 0)
+	if (clp->protocol && (strcmp(clp->protocol, "udp")) == 0)
 		protocol = IPPROTO_UDP;
 
 	switch (addr->sa_family) {
Only in nfs-utils-1.3.4-liu/utils/gssd: gssd_proc.c~
TrevorH

TrevorH

2019-03-07 16:54

manager   ~0033961

CentOS is a rebuild of the sources used to create RHEL. We do not modify anything except to remove branding and logos. You will need to submit your patches to Redhat via bugzilla.redhat.com and if/when RH accept them and incorporate them into RHEL and release the patched version, then CentOS will pick it up and rebuild it.

Issue History

Date Modified Username Field Change
2019-03-04 13:32 ptrrkssn New Issue
2019-03-07 15:43 ptrrkssn File Added: nfs-utils-2.3.3-liu.patch
2019-03-07 15:43 ptrrkssn Note Added: 0033959
2019-03-07 15:48 ptrrkssn File Added: nfs-utils-1.3.0-liu.patch
2019-03-07 15:48 ptrrkssn File Added: nfs-utils-1.3.4-liu.patch
2019-03-07 15:48 ptrrkssn Note Added: 0033960
2019-03-07 16:54 TrevorH Note Added: 0033961