summaryrefslogtreecommitdiffstats
path: root/yocto-poky/meta/recipes-connectivity/nfs-utils
diff options
context:
space:
mode:
Diffstat (limited to 'yocto-poky/meta/recipes-connectivity/nfs-utils')
-rw-r--r--yocto-poky/meta/recipes-connectivity/nfs-utils/files/bugfix-adjust-statd-service-name.patch34
-rw-r--r--yocto-poky/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb2
-rw-r--r--yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-nfs-utils-statd-fix-a-segfault-caused-by-improper-us.patch113
-rw-r--r--yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.3.bb (renamed from yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb)10
4 files changed, 155 insertions, 4 deletions
diff --git a/yocto-poky/meta/recipes-connectivity/nfs-utils/files/bugfix-adjust-statd-service-name.patch b/yocto-poky/meta/recipes-connectivity/nfs-utils/files/bugfix-adjust-statd-service-name.patch
new file mode 100644
index 000000000..14bd4036a
--- /dev/null
+++ b/yocto-poky/meta/recipes-connectivity/nfs-utils/files/bugfix-adjust-statd-service-name.patch
@@ -0,0 +1,34 @@
+From 398fed3bb0350cb1229e54e7020ae0e044c206d1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ulrich=20=C3=96lmann?= <u.oelmann@pengutronix.de>
+Date: Wed, 17 Feb 2016 08:33:45 +0100
+Subject: bugfix: adjust statd service name
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Upstream uses 'rpc-statd.service' and Yocto introduced 'nfs-statd.service'
+instead but forgot to update the mount.nfs helper 'start-statd' accordingly.
+
+Upstream-Status: Inappropriate [other]
+
+Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
+---
+ utils/statd/start-statd | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/utils/statd/start-statd b/utils/statd/start-statd
+index 8211a90..3c2aa6f 100755
+--- a/utils/statd/start-statd
++++ b/utils/statd/start-statd
+@@ -16,7 +16,7 @@ fi
+ # First try systemd if it's installed.
+ if [ -d /run/systemd/system ]; then
+ # Quit only if the call worked.
+- systemctl start rpc-statd.service && exit
++ systemctl start nfs-statd.service && exit
+ fi
+
+ # Fall back to launching it ourselves.
+--
+2.1.4
+
diff --git a/yocto-poky/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb b/yocto-poky/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb
index 5b578e9a1..256577100 100644
--- a/yocto-poky/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb
+++ b/yocto-poky/meta/recipes-connectivity/nfs-utils/libnfsidmap_0.25.bb
@@ -14,6 +14,8 @@ SRC_URI = "http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/${BPN}-${P
SRC_URI[md5sum] = "2ac4893c92716add1a1447ae01df77ab"
SRC_URI[sha256sum] = "656d245d84400e1030f8f40a5a27da76370690c4a932baf249110f047fe7efcf"
+UPSTREAM_CHECK_URI = "http://www.citi.umich.edu/projects/nfsv4/linux/libnfsidmap/"
+
inherit autotools
EXTRA_OECONF = "--disable-ldap"
diff --git a/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-nfs-utils-statd-fix-a-segfault-caused-by-improper-us.patch b/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-nfs-utils-statd-fix-a-segfault-caused-by-improper-us.patch
new file mode 100644
index 000000000..de0b045c8
--- /dev/null
+++ b/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils/0001-nfs-utils-statd-fix-a-segfault-caused-by-improper-us.patch
@@ -0,0 +1,113 @@
+Upstream-Status: Pending
+
+Subject: nfs-utils/statd: fix a segfault caused by improper usage of RPC interface
+
+There is a hack which uses the bottom-level RPC improperly as below
+in the current statd implementation:
+insert a socket in the svc_fdset without a corresponding transport handle
+and passes the socket to the svc_getreqset subroutine, this usage causes
+a segfault of statd on a huge amount of sm-notifications.
+
+Fix the issue by separating the non-RPC-server sock from RPC dispatcher.
+
+Signed-off-by: Shan Hai <shan.hai@windriver.com>
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ utils/statd/rmtcall.c | 1 -
+ utils/statd/statd.c | 5 +++--
+ utils/statd/statd.h | 2 +-
+ utils/statd/svc_run.c | 8 ++++++--
+ 4 files changed, 10 insertions(+), 6 deletions(-)
+
+diff --git a/utils/statd/rmtcall.c b/utils/statd/rmtcall.c
+index fd576d9..cde091b 100644
+--- a/utils/statd/rmtcall.c
++++ b/utils/statd/rmtcall.c
+@@ -104,7 +104,6 @@ statd_get_socket(void)
+ if (sockfd < 0)
+ return -1;
+
+- FD_SET(sockfd, &SVC_FDSET);
+ return sockfd;
+ }
+
+diff --git a/utils/statd/statd.c b/utils/statd/statd.c
+index 51a016e..e21a259 100644
+--- a/utils/statd/statd.c
++++ b/utils/statd/statd.c
+@@ -247,6 +247,7 @@ int main (int argc, char **argv)
+ int port = 0, out_port = 0;
+ int nlm_udp = 0, nlm_tcp = 0;
+ struct rlimit rlim;
++ int notify_sockfd;
+
+ int pipefds[2] = { -1, -1};
+ char status;
+@@ -473,7 +474,7 @@ int main (int argc, char **argv)
+ }
+
+ /* Make sure we have a privilege port for calling into the kernel */
+- if (statd_get_socket() < 0)
++ if ((notify_sockfd = statd_get_socket()) < 0)
+ exit(1);
+
+ /* If sm-notify didn't take all the state files, load
+@@ -528,7 +529,7 @@ int main (int argc, char **argv)
+ * Handle incoming requests: SM_NOTIFY socket requests, as
+ * well as callbacks from lockd.
+ */
+- my_svc_run(); /* I rolled my own, Olaf made it better... */
++ my_svc_run(notify_sockfd); /* I rolled my own, Olaf made it better... */
+
+ /* Only get here when simulating a crash so we should probably
+ * start sm-notify running again. As we have already dropped
+diff --git a/utils/statd/statd.h b/utils/statd/statd.h
+index a1d8035..231ac7e 100644
+--- a/utils/statd/statd.h
++++ b/utils/statd/statd.h
+@@ -28,7 +28,7 @@ extern _Bool statd_present_address(const struct sockaddr *sap, char *buf,
+ __attribute__((__malloc__))
+ extern char * statd_canonical_name(const char *hostname);
+
+-extern void my_svc_run(void);
++extern void my_svc_run(int);
+ extern void notify_hosts(void);
+ extern void shuffle_dirs(void);
+ extern int statd_get_socket(void);
+diff --git a/utils/statd/svc_run.c b/utils/statd/svc_run.c
+index d98ecee..28c1ad6 100644
+--- a/utils/statd/svc_run.c
++++ b/utils/statd/svc_run.c
+@@ -78,7 +78,7 @@ my_svc_exit(void)
+ * The heart of the server. A crib from libc for the most part...
+ */
+ void
+-my_svc_run(void)
++my_svc_run(int sockfd)
+ {
+ FD_SET_TYPE readfds;
+ int selret;
+@@ -96,6 +96,8 @@ my_svc_run(void)
+ }
+
+ readfds = SVC_FDSET;
++ /* Set notify sockfd for waiting for reply */
++ FD_SET(sockfd, &readfds);
+ if (notify) {
+ struct timeval tv;
+
+@@ -125,8 +127,10 @@ my_svc_run(void)
+
+ default:
+ selret -= process_reply(&readfds);
+- if (selret)
++ if (selret) {
++ FD_CLR(sockfd, &readfds);
+ svc_getreqset(&readfds);
++ }
+ }
+ }
+ }
+--
+1.9.1
+
diff --git a/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb b/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.3.bb
index 42101de79..a6268f3d4 100644
--- a/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.1.bb
+++ b/yocto-poky/meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.3.bb
@@ -8,7 +8,7 @@ LICENSE = "MIT & GPLv2+ & BSD"
LIC_FILES_CHKSUM = "file://COPYING;md5=95f3a93a5c3c7888de623b46ea085a84"
# util-linux for libblkid
-DEPENDS = "libcap libnfsidmap libevent util-linux sqlite3"
+DEPENDS = "libcap libnfsidmap libevent util-linux sqlite3 libtirpc"
RDEPENDS_${PN}-client = "rpcbind bash"
RDEPENDS_${PN} = "${PN}-client bash"
RRECOMMENDS_${PN} = "kernel-module-nfsd"
@@ -31,10 +31,12 @@ SRC_URI = "${KERNELORG_MIRROR}/linux/utils/nfs-utils/${PV}/nfs-utils-${PV}.tar.x
file://proc-fs-nfsd.mount \
file://nfs-utils-Do-not-pass-CFLAGS-to-gcc-while-building.patch \
file://nfs-utils-debianize-start-statd.patch \
+ file://0001-nfs-utils-statd-fix-a-segfault-caused-by-improper-us.patch \
+ file://bugfix-adjust-statd-service-name.patch \
"
-SRC_URI[md5sum] = "8de676b9ff34b8f9addc1d0800fabdf8"
-SRC_URI[sha256sum] = "ff79d70b7b58b2c8f9b798c58721127e82bb96022adc04a5c4cb251630e696b8"
+SRC_URI[md5sum] = "cd6b568c2e9301cc3bfac09d87fbbc0b"
+SRC_URI[sha256sum] = "700d689c5622c87953c34102e5befafc4d3c811e676852238f0dd79c9c0c084d"
# Only kernel-module-nfsd is required here (but can be built-in) - the nfsd module will
# pull in the remainder of the dependencies.
@@ -58,12 +60,12 @@ EXTRA_OECONF = "--with-statduser=rpcuser \
--disable-nfsv41 \
--enable-uuid \
--disable-gss \
- --disable-tirpc \
--disable-nfsdcltrack \
--with-statdpath=/var/lib/nfs/statd \
"
PACKAGECONFIG ??= "tcp-wrappers"
+PACKAGECONFIG_remove_libc-musl = "tcp-wrappers"
PACKAGECONFIG[tcp-wrappers] = "--with-tcp-wrappers,--without-tcp-wrappers,tcp-wrappers"
PACKAGECONFIG[nfsidmap] = "--enable-nfsidmap,--disable-nfsidmap,keyutils"
OpenPOWER on IntegriCloud