Commit 51c7ce8a authored by Hannes Frederic Sowa's avatar Hannes Frederic Sowa Committed by Luis Henriques

bridge: Only call /sbin/bridge-stp for the initial network namespace

commit ff621985 upstream.

[I stole this patch from Eric Biederman. He wrote:]

> There is no defined mechanism to pass network namespace information
> into /sbin/bridge-stp therefore don't even try to invoke it except
> for bridge devices in the initial network namespace.
>
> It is possible for unprivileged users to cause /sbin/bridge-stp to be
> invoked for any network device name which if /sbin/bridge-stp does not
> guard against unreasonable arguments or being invoked twice on the
> same network device could cause problems.

[Hannes: changed patch using netns_eq]

Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
Signed-off-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarLuis Henriques <luis.henriques@canonical.com>
parent 660f0e93
...@@ -128,7 +128,10 @@ static void br_stp_start(struct net_bridge *br) ...@@ -128,7 +128,10 @@ static void br_stp_start(struct net_bridge *br)
char *argv[] = { BR_STP_PROG, br->dev->name, "start", NULL }; char *argv[] = { BR_STP_PROG, br->dev->name, "start", NULL };
char *envp[] = { NULL }; char *envp[] = { NULL };
if (net_eq(dev_net(br->dev), &init_net))
r = call_usermodehelper(BR_STP_PROG, argv, envp, UMH_WAIT_PROC); r = call_usermodehelper(BR_STP_PROG, argv, envp, UMH_WAIT_PROC);
else
r = -ENOENT;
spin_lock_bh(&br->lock); spin_lock_bh(&br->lock);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment