[nfs-utils] 03/04: Import Debian version 1:1.2.8-9

debian-kernel at lists.debian.org debian-kernel at lists.debian.org
Fri Mar 11 04:06:38 UTC 2016


This is an automated email from the git hooks/post-receive script.

benh pushed a commit to branch master
in repository nfs-utils.

commit 25546caa99b5aa638be3a9b7507412701c9d85bf
Author: Ben Hutchings <ben at decadent.org.uk>
Date:   Fri Mar 11 04:04:46 2016 +0000

    Import Debian version 1:1.2.8-9
---
 debian/changelog                                   |  8 +++
 ...segfault-in-add_name-with-newer-gcc-compi.patch | 63 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 3 files changed, 72 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 7df8fa0..c00a735 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+nfs-utils (1:1.2.8-9) unstable; urgency=medium
+
+  * debian/patches/22-mountd-fix-segfault-in-add_name-with-newer-gcc-
+    compi.patch: cherry-pick fix from upstream for a segfault in 
+    add_name with newer gcc compilers.  Closes: #757835, LP: #1355829.
+
+ -- Steve Langasek <vorlon at debian.org>  Tue, 12 Aug 2014 17:12:38 -0700
+
 nfs-utils (1:1.2.8-8) unstable; urgency=medium
 
   * Upload to unstable where this belongs.
diff --git a/debian/patches/22-mountd-fix-segfault-in-add_name-with-newer-gcc-compi.patch b/debian/patches/22-mountd-fix-segfault-in-add_name-with-newer-gcc-compi.patch
new file mode 100644
index 0000000..a2ea91b
--- /dev/null
+++ b/debian/patches/22-mountd-fix-segfault-in-add_name-with-newer-gcc-compi.patch
@@ -0,0 +1,63 @@
+From 8b03fdbfb0dd8e0147aa61ff30b8311235caf5f3 Mon Sep 17 00:00:00 2001
+From: Jeff Layton <jlayton at poochiereds.net>
+Date: Thu, 1 May 2014 11:15:16 -0400
+Subject: [PATCH] mountd: fix segfault in add_name with newer gcc compilers
+Bug-Debian: http://bugs.debian.org/757835
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+bug/1355829
+
+I hit a segfault in add_name with a mountd built with gcc-4.9.0. Some
+NULL pointer checks got reordered such that a pointer was dereferenced
+before checking to see whether it was NULL. The problem was due to
+nfs-utils relying on undefined behavior, which tricked gcc into assuming
+that the pointer would never be NULL.
+
+At first I assumed that this was a compiler bug, but Jakub Jelinek and
+Jeff Law pointed out:
+
+"If old is NULL, then:
+
+	strncpy(new, old, cp-old);
+
+is undefined behavior (even when cp == old == NULL in that case),
+therefore gcc assumes that old is never NULL, as otherwise it would be
+invalid.
+
+Just guard
+	strncpy(new, old, cp-old);
+	new[cp-old] = 0;
+with if (old) { ... }."
+
+This patch does that. If old is NULL though, then we still need to
+ensure that new is NULL terminated, lest the subsequent strcats walk off
+the end of it.
+
+Cc: Jeff Law <law at redhat.com>
+Cc: Jakub Jelinek <jakub at redhat.com>
+Signed-off-by: Jeff Layton <jlayton at poochiereds.net>
+Signed-off-by: Steve Dickson <steved at redhat.com>
+---
+ support/export/client.c | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/support/export/client.c b/support/export/client.c
+index ba2db8f..e749cac 100644
+--- a/support/export/client.c
++++ b/support/export/client.c
+@@ -482,8 +482,12 @@ add_name(char *old, const char *add)
+ 		else
+ 			cp = cp + strlen(cp);
+ 	}
+-	strncpy(new, old, cp-old);
+-	new[cp-old] = 0;
++	if (old) {
++		strncpy(new, old, cp-old);
++		new[cp-old] = 0;
++	} else {
++		new[0] = 0;
++	}
+ 	if (cp != old && !*cp)
+ 		strcat(new, ",");
+ 	strcat(new, add);
+-- 
+2.1.0.rc1
+
diff --git a/debian/patches/series b/debian/patches/series
index bf91ce0..8c74c78 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@
 17-multiarch-kerberos-paths.patch
 19-iscsiadm-path.patch
 20-remove-autogenerated-man.patch
+22-mountd-fix-segfault-in-add_name-with-newer-gcc-compi.patch 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/nfs-utils.git



More information about the Kernel-svn-changes mailing list