]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
nfs-utils: backport accepted patch for statd segfault
authorAndreas Oberritter <obi@opendreambox.org>
Mon, 23 May 2016 15:49:53 +0000 (17:49 +0200)
committerAndreas Oberritter <obi@opendreambox.org>
Tue, 17 Oct 2017 02:38:27 +0000 (04:38 +0200)
Signed-off-by: Andreas Oberritter <obi@opendreambox.org>
meta/recipes-connectivity/nfs-utils/nfs-utils/0001-statd-fix-a-segfault-caused-by-improper-usage-of-RPC.patch [moved from meta/recipes-connectivity/nfs-utils/nfs-utils/0001-nfs-utils-statd-fix-a-segfault-caused-by-improper-us.patch with 72% similarity]
meta/recipes-connectivity/nfs-utils/nfs-utils_1.3.3.bb

similarity index 72%
rename from meta/recipes-connectivity/nfs-utils/nfs-utils/0001-nfs-utils-statd-fix-a-segfault-caused-by-improper-us.patch
rename to meta/recipes-connectivity/nfs-utils/nfs-utils/0001-statd-fix-a-segfault-caused-by-improper-usage-of-RPC.patch
index de0b045c8c03764abab40ba3166884cf4794fb47..3d469ac70f95899ad629396b3dd4a4ec26eb3ce3 100644 (file)
@@ -1,17 +1,23 @@
-Upstream-Status: Pending
+Upstream-Status: Backport
 
-Subject: nfs-utils/statd: fix a segfault caused by improper usage of RPC interface
+From 2fc23d7978e50394599bfd0a881d6081293432b2 Mon Sep 17 00:00:00 2001
+From: Shan Hai <shan.hai@windriver.com>
+Date: Mon, 2 Nov 2015 08:03:24 -0500
+Subject: [PATCH] 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.
+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.
+Fix the issue by separating the non-RPC-server socket from RPC
+dispatcher.
 
 Signed-off-by: Shan Hai <shan.hai@windriver.com>
-Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+Signed-off-by: Steve Dickson <steved@redhat.com>
+(cherry picked from commit 7f62e37fcd25f09949a547b93c35d9e324211102)
 ---
  utils/statd/rmtcall.c | 1 -
  utils/statd/statd.c   | 5 +++--
@@ -20,10 +26,10 @@ Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
  4 files changed, 10 insertions(+), 6 deletions(-)
 
 diff --git a/utils/statd/rmtcall.c b/utils/statd/rmtcall.c
-index fd576d9..cde091b 100644
+index 45c84f9..c4f6364 100644
 --- a/utils/statd/rmtcall.c
 +++ b/utils/statd/rmtcall.c
-@@ -104,7 +104,6 @@ statd_get_socket(void)
+@@ -113,7 +113,6 @@ statd_get_socket(void)
        if (sockfd < 0)
                return -1;
  
@@ -32,7 +38,7 @@ index fd576d9..cde091b 100644
  }
  
 diff --git a/utils/statd/statd.c b/utils/statd/statd.c
-index 51a016e..e21a259 100644
+index 2b7a167..e5b4c98 100644
 --- a/utils/statd/statd.c
 +++ b/utils/statd/statd.c
 @@ -247,6 +247,7 @@ int main (int argc, char **argv)
@@ -41,9 +47,9 @@ index 51a016e..e21a259 100644
        struct rlimit rlim;
 +      int notify_sockfd;
  
-       int pipefds[2] = { -1, -1};
-       char status;
-@@ -473,7 +474,7 @@ int main (int argc, char **argv)
+       /* Default: daemon mode, no other options */
+       run_mode = 0;
+@@ -437,7 +438,7 @@ int main (int argc, char **argv)
                }
  
        /* Make sure we have a privilege port for calling into the kernel */
@@ -52,7 +58,7 @@ index 51a016e..e21a259 100644
                exit(1);
  
        /* If sm-notify didn't take all the state files, load
-@@ -528,7 +529,7 @@ int main (int argc, char **argv)
+@@ -484,7 +485,7 @@ int main (int argc, char **argv)
                 * Handle incoming requests:  SM_NOTIFY socket requests, as
                 * well as callbacks from lockd.
                 */
@@ -108,6 +114,3 @@ index d98ecee..28c1ad6 100644
                }
        }
  }
--- 
-1.9.1
-
index cc1bca418d674deee8f4409bd2a465050ed2a68b..0391f5bebbd50e8c531da3b46b9eea8ed6885087 100644 (file)
@@ -30,7 +30,7 @@ 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://0001-statd-fix-a-segfault-caused-by-improper-usage-of-RPC.patch \
            file://bugfix-adjust-statd-service-name.patch \
 "