From: Khem Raj <raj.khem@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 2/2] nfs-utils: Fix exportfs segfault on musl
Date: Fri, 30 Nov 2018 17:08:07 -0800 [thread overview]
Message-ID: <20181201010807.28924-2-raj.khem@gmail.com> (raw)
In-Reply-To: <20181201010807.28924-1-raj.khem@gmail.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
...ot-pass-null-pointer-to-freeaddrinfo.patch | 32 +++++++++++++++++++
.../nfs-utils/nfs-utils_2.3.2.bb | 1 +
2 files changed, 33 insertions(+)
create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch
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.2.bb b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.2.bb
index 5c0586fa75..9b3f36d343 100644
--- a/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.2.bb
+++ b/meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.2.bb
@@ -30,6 +30,7 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x
file://nfs-utils-debianize-start-statd.patch \
file://bugfix-adjust-statd-service-name.patch \
file://nfs-utils-musl-limits.patch \
+ file://0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch \
"
SRC_URI_append_libc-musl = " file://nfs-utils-musl-res_querydomain.patch"
--
2.19.2
next prev parent reply other threads:[~2018-12-01 1:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-01 1:08 [PATCH 1/2] nfs-utils: Upgrade to 2.3.2 Khem Raj
2018-12-01 1:08 ` Khem Raj [this message]
2018-12-01 11:16 ` Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181201010807.28924-2-raj.khem@gmail.com \
--to=raj.khem@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox