naccyde / rpms / iproute

Forked from rpms/iproute 10 months ago
Clone

Blame SOURCES/0001-netns-make-var-run-netns-bind-mount-recursive.patch

d8fb9e
From 7348e6148f641d4bc24cb3277ac9fa7675a1825c Mon Sep 17 00:00:00 2001
d30c09
From: Andrea Claudi <aclaudi@redhat.com>
d8fb9e
Date: Wed, 13 Nov 2019 11:40:24 +0100
d30c09
Subject: [PATCH] netns: make /var/run/netns bind-mount recursive
d30c09
d8fb9e
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1771556
d30c09
Upstream Status: iproute2.git commit d6a4076b6ba65
d30c09
d30c09
commit d6a4076b6ba6547d7e52c377a7c58c56eb5ea16e
d30c09
Author: Casey Callendrello <casey.callendrello@coreos.com>
d30c09
Date:   Tue Aug 1 17:46:09 2017 +0200
d30c09
d30c09
    netns: make /var/run/netns bind-mount recursive
d30c09
d30c09
    When ip netns {add|delete} is first run, it bind-mounts /var/run/netns
d30c09
    on top of itself, then marks it as shared. However, if there are already
d30c09
    bind-mounts in the directory from other tools, these would not be
d30c09
    propagated. Fix this by recursively bind-mounting.
d30c09
d30c09
    Signed-off-by: Casey Callendrello <casey.callendrello@coreos.com>
d30c09
    Acked-by: "Eric W. Biederman" <ebiederm@xmission.com>
d30c09
---
d30c09
 ip/ipnetns.c | 2 +-
d30c09
 1 file changed, 1 insertion(+), 1 deletion(-)
d30c09
d30c09
diff --git a/ip/ipnetns.c b/ip/ipnetns.c
d30c09
index 427b59c57381d..c8e22e9b6e952 100644
d30c09
--- a/ip/ipnetns.c
d30c09
+++ b/ip/ipnetns.c
d30c09
@@ -640,7 +640,7 @@ static int netns_add(int argc, char **argv)
d30c09
 		}
d30c09
 
d30c09
 		/* Upgrade NETNS_RUN_DIR to a mount point */
d30c09
-		if (mount(NETNS_RUN_DIR, NETNS_RUN_DIR, "none", MS_BIND, NULL)) {
d30c09
+		if (mount(NETNS_RUN_DIR, NETNS_RUN_DIR, "none", MS_BIND | MS_REC, NULL)) {
d30c09
 			fprintf(stderr, "mount --bind %s %s failed: %s\n",
d30c09
 				NETNS_RUN_DIR, NETNS_RUN_DIR, strerror(errno));
d30c09
 			return -1;
d30c09
-- 
d30c09
2.21.0
d30c09