]> 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)
committerAndi Kleen <ak@linux.intel.com>
Mon, 1 Aug 2011 20:54:47 +0000 (13:54 -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>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
net/phonet/pn_dev.c

index c33da65769420555a4a3cb60c0d5585519111f11..29ae2bd677ce72fdb8f4e15ccabfbbdb669557bd 100644 (file)
@@ -298,6 +298,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)