summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2018-12-01 10:12:54 -0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-12-03 12:19:43 +0000
commitc5c0342908ca81aacfe3cba1427fa77751bed53b (patch)
tree95d352633321b5da90cbcbff60618c2bb4cfa581 /meta
parent61290f91e6667e1e494f6d9cb8c19ebecda122b5 (diff)
downloadopenembedded-core-contrib-c5c0342908ca81aacfe3cba1427fa77751bed53b.tar.gz
nfs-utils: Fix exportfs segfault on musl
Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch32
-rw-r--r--meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.3.bb1
2 files changed, 33 insertions, 0 deletions
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch
new file mode 100644
index 0000000000..a44d1bf2fe
--- /dev/null
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch
@@ -0,0 +1,32 @@
+From 4f115fc314646500f7b4178d7248a02654c7cd10 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem@gmail.com>
+Date: Fri, 30 Nov 2018 16:47:57 -0800
+Subject: [PATCH] Do not pass null pointer to freeaddrinfo()
+
+Passing null pointer as input parameter to freeaddrinfo() is undefined
+behaviour, some libcs e.g. glibc might just call free() which does
+accept null pointer but other libcs e.g. musl might not and instead
+cause the program to segfault. Therefore do not rely on undefined
+behaviour instead make it deterministic
+
+Upstream-Status: Pending
+
+Signed-off-by: Khem Raj <raj.khem@gmail.com>
+---
+ support/export/client.c | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+Index: nfs-utils-2.3.2/support/export/client.c
+===================================================================
+--- nfs-utils-2.3.2.orig/support/export/client.c
++++ nfs-utils-2.3.2/support/export/client.c
+@@ -309,7 +309,8 @@ client_lookup(char *hname, int canonical
+ init_addrlist(clp, ai);
+
+ out:
+- freeaddrinfo(ai);
++ if (ai)
++ freeaddrinfo(ai);
+ return clp;
+ }
+
diff --git a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.3.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.3.bb
index 35587dfb7a..572ae3146f 100644
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.3.bb
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.3.bb
@@ -31,6 +31,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x
file://bugfix-adjust-statd-service-name.patch \
file://nfs-utils-musl-limits.patch \
file://0001-cacheio-use-intmax_t-for-formatted-IO.patch \
+ file://0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch \
"
SRC_URI_append_libc-musl = " file://nfs-utils-musl-res_querydomain.patch"