]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Phonet: device notifier only runs on initial namespace
authorRémi Denis-Courmont <remi.denis-courmont@nokia.com>
Mon, 25 Oct 2010 07:43:32 +0000 (10:43 +0300)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 9 May 2011 22:55:39 +0000 (15:55 -0700)
[bwh: This is only applicable to 2.6.32. Phonet was fixed upstream to
work with multiple net namespaces.]

This should really fix the OOPS when doing:

  unshare(CLONE_NEWNET);
  exit(0);

while the phonet module is loaded.

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
net/phonet/pn_dev.c

index 5a2275c4ee79d8ad6b4432916af37e73982c92ea..d94ca91334d380d4c31c30a24271cc13add2a032 100644 (file)
@@ -225,6 +225,9 @@ static int phonet_device_notify(struct notifier_block *me, unsigned long what,
 {
        struct net_device *dev = arg;
 
+       if (!net_eq(dev_net(dev), &init_net))
+               return 0;
+
        switch (what) {
        case NETDEV_REGISTER:
                if (dev->type == ARPHRD_PHONET)