[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#594845: Acknowledgement (linux-image-2.6.32-5-amd64: kernel BUG at /build/buildd-linux-2.6_2.6.32-20-amd64-lNUT1p/..../fs/sysfs/file.c:539)

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


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 <ben@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-debian@stuart.id.au>
Signed-off-by: Ben Hutchings <ben@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");

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

Reply to: