From: Rémi Denis-Courmont Date: Mon, 25 Oct 2010 07:43:32 +0000 (+0300) Subject: Phonet: device notifier only runs on initial namespace X-Git-Tag: v2.6.35.14~188 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d58f50ab3cb89696982deeae32ef9e0eab96f787;p=thirdparty%2Fkernel%2Fstable.git Phonet: device notifier only runs on initial namespace [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 Signed-off-by: Greg Kroah-Hartman Signed-off-by: Andi Kleen --- diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c index c33da65769420..29ae2bd677ce7 100644 --- a/net/phonet/pn_dev.c +++ b/net/phonet/pn_dev.c @@ -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)