]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
nfs-utils: backport fixes for a segfault and broken protocol fallback
authorAndreas Oberritter <obi@opendreambox.org>
Mon, 23 May 2016 15:51:13 +0000 (17:51 +0200)
committerAndreas Oberritter <obi@opendreambox.org>
Tue, 17 Oct 2017 02:38:27 +0000 (04:38 +0200)
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
meta/recipes-connectivity/nfs-utils/nfs-utils/0002-mount.nfs-fix-null-pointer-derefernce-in-nfs_parse_s.patch [new file with mode: 0644]
meta/recipes-connectivity/nfs-utils/nfs-utils/0003-Fix-protocol-minor-version-fall-back.patch [new file with mode: 0644]
meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.3.bb

diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0002-mount.nfs-fix-null-pointer-derefernce-in-nfs_parse_s.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0002-mount.nfs-fix-null-pointer-derefernce-in-nfs_parse_s.patch
new file mode 100644 (file)
index 0000000..12ba16e
--- /dev/null
@@ -0,0 +1,33 @@
+Upstream-Status: Backport
+
+From b4832606d847c4aaaaafdd4bfbf47a4d25a1b4c4 Mon Sep 17 00:00:00 2001
+From: Vivek Trivedi <t.vivek@samsung.com>
+Date: Fri, 11 Dec 2015 10:58:01 -0500
+Subject: [PATCH] mount.nfs: fix null pointer derefernce in
+ nfs_parse_simple_hostname
+
+In function nfs_parse_simple_hostname, hostname can be NULL,
+dereferncing it while passing it to free(*hostname) may result in
+segfault.
+
+Signed-off-by: Vivek Trivedi <t.vivek@samsung.com>
+Signed-off-by: Steve Dickson <steved@redhat.com>
+(cherry picked from commit 9c3d8687c96b7fe4a7920dc474e91f190b6d8f37)
+---
+ utils/mount/parse_dev.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/utils/mount/parse_dev.c b/utils/mount/parse_dev.c
+index d64b83d..0d3bcb9 100644
+--- a/utils/mount/parse_dev.c
++++ b/utils/mount/parse_dev.c
+@@ -118,7 +118,8 @@ static int nfs_parse_simple_hostname(const char *dev,
+       if (pathname) {
+               *pathname = strndup(colon, path_len);
+               if (*pathname == NULL) {
+-                      free(*hostname);
++                      if (hostname)
++                              free(*hostname);
+                       return nfs_pdn_nomem_err();
+               }
+       }
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0003-Fix-protocol-minor-version-fall-back.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0003-Fix-protocol-minor-version-fall-back.patch
new file mode 100644 (file)
index 0000000..9551207
--- /dev/null
@@ -0,0 +1,51 @@
+Upstream-Status: Backport
+
+From 37fc32264524cce40c411fadab0e7abde5458293 Mon Sep 17 00:00:00 2001
+From: Takashi Iwai <tiwai@suse.com>
+Date: Sat, 16 Jan 2016 12:02:30 -0500
+Subject: [PATCH] Fix protocol minor version fall-back
+
+mount.nfs currently expects mount(2) to fail with EPROTONOSUPPORT if
+the kernel doesn't understand the requested NFS version.
+
+Unfortunately if the requested minor is not known to the kernel
+it returns -EINVAL.
+In kernels since 3.11 this can happen in nfs4_alloc_client(), if
+compiled without NFS_V4_2.
+
+More generally it can happen in in nfs_validate_text_mount_data()
+when nfs_parse_mount_options() returns 0 because
+nfs_parse_version_string()
+didn't recognise the version.
+
+EPROTONOSUPPORT is only returned if NFSv4 support is completely compiled
+out.
+
+So nfs_autonegotiate needs to check for EINVAL as well as
+EPROTONOSUPPORT.
+
+URL: https://bugzilla.opensuse.org/show_bug.cgi?id=959211
+Reported-by: Takashi Iwai <tiwai@suse.com>
+Signed-off-by: NeilBrown <neilb@suse.com>
+Signed-off-by: Steve Dickson <steved@redhat.com>
+(cherry picked from commit 78bb645a42c216b37b8d930c7c849a3fa89babf8)
+Signed-off-by: Andreas Oberritter <obi@saftware.de>
+(cherry picked from commit df543ba03220b13f8e4dc947b3de362c8334cef9)
+---
+ utils/mount/stropts.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
+index c8f5a6d..86829a9 100644
+--- a/utils/mount/stropts.c
++++ b/utils/mount/stropts.c
+@@ -841,6 +841,9 @@ check_result:
+       case EPROTONOSUPPORT:
+               /* A clear indication that the server or our
+                * client does not support NFS version 4 and minor */
++      case EINVAL:
++              /* A less clear indication that our client
++               * does not support NFSv4 minor version. */
+               if (mi->version.v_mode == V_GENERAL &&
+                       mi->version.minor == 0)
+                               return result;
index 0391f5bebbd50e8c531da3b46b9eea8ed6885087..61c354afa932c8d56fb62d70821f0a51645afb9f 100644 (file)
@@ -31,6 +31,8 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x
            file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \
            file://nfs-utils-debianize-start-statd.patch \
            file://0001-statd-fix-a-segfault-caused-by-improper-usage-of-RPC.patch \
+           file://0002-mount.nfs-fix-null-pointer-derefernce-in-nfs_parse_s.patch \
+           file://0003-Fix-protocol-minor-version-fall-back.patch \
            file://bugfix-adjust-statd-service-name.patch \
 "