Skip to content

Commit

Permalink
bridge: Only call /sbin/bridge-stp for the initial network namespace
Browse files Browse the repository at this point in the history
[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 <[email protected]>
Signed-off-by: Eric W. Biederman <[email protected]>
Signed-off-by: Hannes Frederic Sowa <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
strssndktn authored and davem330 committed Jan 5, 2016
1 parent c845acb commit ff62198
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion net/bridge/br_stp_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ static void br_stp_start(struct net_bridge *br)
char *envp[] = { NULL };
struct net_bridge_port *p;

r = call_usermodehelper(BR_STP_PROG, argv, envp, UMH_WAIT_PROC);
if (net_eq(dev_net(br->dev), &init_net))
r = call_usermodehelper(BR_STP_PROG, argv, envp, UMH_WAIT_PROC);
else
r = -ENOENT;

spin_lock_bh(&br->lock);

Expand Down

0 comments on commit ff62198

Please sign in to comment.