diff options
| author | Khem Raj <raj.khem@gmail.com> | 2018-12-01 10:12:54 -0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-12-03 12:20:01 +0000 |
| commit | e792fdbfb992d17ee431571893e10141e4d66e7f (patch) | |
| tree | 7641d58f99ab90aced75f252f75816d347286b23 | |
| parent | b5ff76a701687dd23508e0bcdc8f72451fd48167 (diff) | |
| download | poky-e792fdbfb992d17ee431571893e10141e4d66e7f.tar.gz | |
nfs-utils: Fix exportfs segfault on musl
(From OE-Core rev: c5c0342908ca81aacfe3cba1427fa77751bed53b)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
| -rw-r--r-- | meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch | 32 | ||||
| -rw-r--r-- | meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.3.bb | 1 |
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 @@ | |||
| 1 | From 4f115fc314646500f7b4178d7248a02654c7cd10 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Fri, 30 Nov 2018 16:47:57 -0800 | ||
| 4 | Subject: [PATCH] Do not pass null pointer to freeaddrinfo() | ||
| 5 | |||
| 6 | Passing null pointer as input parameter to freeaddrinfo() is undefined | ||
| 7 | behaviour, some libcs e.g. glibc might just call free() which does | ||
| 8 | accept null pointer but other libcs e.g. musl might not and instead | ||
| 9 | cause the program to segfault. Therefore do not rely on undefined | ||
| 10 | behaviour instead make it deterministic | ||
| 11 | |||
| 12 | Upstream-Status: Pending | ||
| 13 | |||
| 14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 15 | --- | ||
| 16 | support/export/client.c | 3 ++- | ||
| 17 | 1 file changed, 2 insertions(+), 1 deletion(-) | ||
| 18 | |||
| 19 | Index: nfs-utils-2.3.2/support/export/client.c | ||
| 20 | =================================================================== | ||
| 21 | --- nfs-utils-2.3.2.orig/support/export/client.c | ||
| 22 | +++ nfs-utils-2.3.2/support/export/client.c | ||
| 23 | @@ -309,7 +309,8 @@ client_lookup(char *hname, int canonical | ||
| 24 | init_addrlist(clp, ai); | ||
| 25 | |||
| 26 | out: | ||
| 27 | - freeaddrinfo(ai); | ||
| 28 | + if (ai) | ||
| 29 | + freeaddrinfo(ai); | ||
| 30 | return clp; | ||
| 31 | } | ||
| 32 | |||
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 | |||
| 31 | file://bugfix-adjust-statd-service-name.patch \ | 31 | file://bugfix-adjust-statd-service-name.patch \ |
| 32 | file://nfs-utils-musl-limits.patch \ | 32 | file://nfs-utils-musl-limits.patch \ |
| 33 | file://0001-cacheio-use-intmax_t-for-formatted-IO.patch \ | 33 | file://0001-cacheio-use-intmax_t-for-formatted-IO.patch \ |
| 34 | file://0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch \ | ||
| 34 | " | 35 | " |
| 35 | 36 | ||
| 36 | SRC_URI_append_libc-musl = " file://nfs-utils-musl-res_querydomain.patch" | 37 | SRC_URI_append_libc-musl = " file://nfs-utils-musl-res_querydomain.patch" |
