summarylogtreecommitdiffstats
path: root/0001-nmp-netns-Mount-proc-in-the-new-namespace.patch
diff options
context:
space:
mode:
Diffstat (limited to '0001-nmp-netns-Mount-proc-in-the-new-namespace.patch')
-rw-r--r--0001-nmp-netns-Mount-proc-in-the-new-namespace.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/0001-nmp-netns-Mount-proc-in-the-new-namespace.patch b/0001-nmp-netns-Mount-proc-in-the-new-namespace.patch
new file mode 100644
index 000000000000..78726f824942
--- /dev/null
+++ b/0001-nmp-netns-Mount-proc-in-the-new-namespace.patch
@@ -0,0 +1,43 @@
+From 0acfc3e775b7ea3fccefd48f90644ef85fd76b3b Mon Sep 17 00:00:00 2001
+Message-Id: <0acfc3e775b7ea3fccefd48f90644ef85fd76b3b.1515702272.git.jan.steffens@gmail.com>
+From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
+Date: Thu, 11 Jan 2018 21:23:38 +0100
+Subject: [PATCH] nmp-netns: Mount /proc in the new namespace
+
+The /proc inherited from the parent namespace might be read-only.
+---
+ src/platform/nmp-netns.c | 12 ++++++++++++
+ 1 file changed, 12 insertions(+)
+
+diff --git a/src/platform/nmp-netns.c b/src/platform/nmp-netns.c
+index e31c881d6..7ec647241 100644
+--- a/src/platform/nmp-netns.c
++++ b/src/platform/nmp-netns.c
+@@ -503,12 +503,24 @@ nmp_netns_new (void)
+ goto err_out;
+ }
+
++ if (umount2 ("/proc", MNT_DETACH) != 0) {
++ errsv = errno;
++ _LOGE (NULL, "failed umount /proc: %s", g_strerror (errsv));
++ goto err_out;
++ }
++
+ if (mount ("sysfs", "/sys", "sysfs", 0, NULL) != 0) {
+ errsv = errno;
+ _LOGE (NULL, "failed mount /sys: %s", g_strerror (errsv));
+ goto err_out;
+ }
+
++ if (mount ("proc", "/proc", "proc", 0, NULL) != 0) {
++ errsv = errno;
++ _LOGE (NULL, "failed mount /proc: %s", g_strerror (errsv));
++ goto err_out;
++ }
++
+ self = _netns_new (&error);
+ if (!self) {
+ errsv = errno;
+--
+2.15.1
+