diff options
author | Andreas Oberritter <obi@opendreambox.org> | 2016-05-23 17:51:13 +0200 |
---|---|---|
committer | Andreas Oberritter <obi@opendreambox.org> | 2017-06-26 22:57:15 +0200 |
commit | 5ebe2060b7326df7f61c714c1913d7d3173be3ea (patch) | |
tree | 8f6085d3dc6bc4962eb47d79b6f1614adc90acb5 | |
parent | bb701efdc12770b45e1ccd6e292f5ed59c364804 (diff) | |
download | openembedded-core-contrib-5ebe2060b7326df7f61c714c1913d7d3173be3ea.tar.gz |
nfs-utils: backport fixes for a segfault and broken protocol fallback
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
3 files changed, 86 insertions, 0 deletions
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 index 0000000000..12ba16e6df --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0002-mount.nfs-fix-null-pointer-derefernce-in-nfs_parse_s.patch @@ -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 index 0000000000..9551207cf3 --- /dev/null +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0003-Fix-protocol-minor-version-fall-back.patch @@ -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; diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.3.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.3.bb index 0391f5bebb..61c354afa9 100644 --- a/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.3.bb +++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.3.bb @@ -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 \ " |