Re: [64/66] Phonet: disable network namespace support

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: =?utf-8?q?R=C3=A9mi?= Denis-Courmont
Date: Monday, October 25, 2010 - 12:43 am

On Saturday 23 October 2010 00:22:33 ext Ben Hutchings, you wrote:

I don´t actually remember, but I obviously missed something :-(
With similar problem reports in Nokia/MeeGo, that´ s what I added last week:

From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
Subject: [PATCH] Phonet: device notifier only runs on initial namespace

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>
---
 net/phonet/pn_dev.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c
index 5a2275c..d94ca91 100644
--- a/net/phonet/pn_dev.c
+++ b/net/phonet/pn_dev.c
@@ -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)
-- 
1.7.1
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[64/66] Phonet: disable network namespace support, Greg KH, (Fri Oct 22, 11:35 am)
Re: [64/66] Phonet: disable network namespace support, Ben Hutchings, (Fri Oct 22, 2:22 pm)
Re: [64/66] Phonet: disable network namespace support, =?utf-8?q?R=C3=A9mi? ..., (Mon Oct 25, 12:43 am)