nfs-utils: Upgrade to 2.3.3
PATCH v2 1/2 nfs-utils: Upgrade to 2.3.3
enhance the musl-only patch to degrade certain Werros into Warnings which helps in compiling on musl, since its checking for __GLIBC__ defines which are undefined on musl.
fix build on x32 ABI
Signed-off-by Khem Raj <[email protected]>
---
V2: Upgrade to 2.3.3 and fix build with x32 ABI
...acheio-use-intmax_t-for-formatted-IO.patch | 38 ++++++++++++++++
.../nfs-utils-musl-res_querydomain.patch | 43 +++++++++++++++++--
...{nfs-utils_2.3.1.bb => nfs-utils_2.3.3.bb} | 5 ++-
3 files changed, 80 insertions(+), 6 deletions(-)
create mode 100644 meta/recipes-connectivity/nfs-utils/nfs-utils/0001-cacheio-use-intmax_t-for-formatted-IO.patch
rename meta/recipes-connectivity/nfs-utils/{nfs-utils_2.3.1.bb => nfs-utils_2.3.3.bb} (96%)meta/recipes-connectivity/nfs-utils/nfs-utils/0001-cacheio-use-intmax_t-for-formatted-IO.patch new file +38 -0
@@ -0,0 +1,38 @@ +From ac32b813f5d6f9a2de944015cf9bb98d68e0203a Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Sat, 1 Dec 2018 10:02:12 -0800 +Subject: [PATCH] cacheio: use intmax_t for formatted IO + +time_t is not same size on x32 ABI (ILP32) + +Upstream-Status: Pending + +Signed-off-by: Khem Raj <[email protected]> +--- + support/nfs/cacheio.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/support/nfs/cacheio.c b/support/nfs/cacheio.c +index 9dc4cf1..2086a95 100644 +--- a/support/nfs/cacheio.c ++++ b/support/nfs/cacheio.c +@@ -17,6 +17,7 @@ + + #include <nfslib.h> + #include <stdio.h> ++#include <inttypes.h> + #include <stdio_ext.h> + #include <string.h> + #include <ctype.h> +@@ -234,7 +235,7 @@ cache_flush(int force) + stb.st_mtime > now) + stb.st_mtime = time(0); + +- sprintf(stime, "%ld\n", stb.st_mtime); ++ sprintf(stime, "%jd\n", (intmax_t)stb.st_mtime); + for (c=0; cachelist[c]; c++) { + int fd; + sprintf(path, "/proc/net/rpc/%s/flush", cachelist[c]); +-- +2.19.2 +
meta/recipes-connectivity/nfs-utils/nfs-utils/nfs-utils-musl-res_querydomain.patch +39 -4
59 lines not on this page · raw message
meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.3.bb renamed from meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.1.bb +3 -2
@@ -30,12 +30,13 @@ 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-cacheio-use-intmax_t-for-formatted-IO.patch \ " SRC_URI_append_libc-musl = " file://nfs-utils-musl-res_querydomain.patch" -SRC_URI[md5sum] = "d77b182a9ee396aa6221ac2401ad7046" -SRC_URI[sha256sum] = "96d06b5a86b185815760d8f04c34fdface8fa8b9949ff256ac05c3ebc08335a5" +SRC_URI[md5sum] = "b6c9c032995af1c08fea9fbcc1ce33e9" +SRC_URI[sha256sum] = "f68b34793831b05f1fd5760d6bdec92772c7684177586a99a61e7b444f336322" # Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will # pull in the remainder of the dependencies.
Signature · 1 line
2.19.2
PATCH v2 2/2 nfs-utils: Fix exportfs segfault on musl
Signed-off-by Khem Raj <[email protected]>
---
V2: Rebased
...ot-pass-null-pointer-to-freeaddrinfo.patch | 32 +++++++++++++++++++ .../nfs-utils/nfs-utils_2.3.3.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
meta/recipes-connectivity/nfs-utils/nfs-utils/0001-Do-not-pass-null-pointer-to-freeaddrinfo.patch new file +32 -0
@@ -0,0 +1,32 @@ +From 4f115fc314646500f7b4178d7248a02654c7cd10 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +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 <[email protected]> +--- + 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; + } +
meta/recipes-connectivity/nfs-utils/nfs-utils_2.3.3.bb +1 -0
@@ -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"
Signature · 1 line
2.19.2