On Mon, 2010-08-30 at 17:34 +1000, Russell Stuart wrote:
> The problem disappears in
> linux-image-2.6.35-trunk-amd64_2.6.35-1~experimental.2.

Yes, as I expected.

Can you please test the attached patch against the version in unstable?
Directions for rebuilding an official kernel package are at
<http://kernel-handbook.alioth.debian.org/ch-common-tasks.html#s-common-official>.

Ben.

-- 
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.
From e5e7a7a14da22681abd96a305753e8cdcf898d40 Mon Sep 17 00:00:00 2001
From: Ben Hutchings <b...@decadent.org.uk>
Date: Mon, 30 Aug 2010 14:38:14 +0100
Subject: [PATCH] tun: Don't add sysfs attributes to devices without sysfs directories

Prior to Linux 2.6.35, net devices outside the initial net namespace
did not have sysfs directories.  Attempting to add attributes to
them will trigger a BUG().

Reported-by: Russell Stuart <russell-deb...@stuart.id.au>
Signed-off-by: Ben Hutchings <b...@decadent.org.uk>
---
 drivers/net/tun.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 4fdfa2a..0f77aca 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1006,7 +1006,8 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
 		if (err < 0)
 			goto err_free_sk;
 
-		if (device_create_file(&tun->dev->dev, &dev_attr_tun_flags) ||
+		if (!net_eq(dev_net(tun->dev), &init_net) ||
+		    device_create_file(&tun->dev->dev, &dev_attr_tun_flags) ||
 		    device_create_file(&tun->dev->dev, &dev_attr_owner) ||
 		    device_create_file(&tun->dev->dev, &dev_attr_group))
 			printk(KERN_ERR "Failed to create tun sysfs files\n");
-- 
1.7.1

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to