lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <E1JyB6E-0000Ya-6v@pomaz-ex.szeredi.hu>
Date:	Mon, 19 May 2008 21:32:46 +0200
From:	Miklos Szeredi <miklos@...redi.hu>
To:	opslynx@...il.com
CC:	miklos@...redi.hu, linux-kernel@...r.kernel.org, mszeredi@...e.cz,
	a.p.zijlstra@...llo.nl, akpm@...ux-foundation.org
Subject: Re: BISECTED REGRESSION: 2.6.26-rc2: FUSE changes break mount of ntfs-3g

> > Thanks.  I've tried to reproduce this bug, but was unable to.
> >
> > That patch looks OK to me, however there's something very weird going
> > on if sysfs_add_one() gets called with an already existing name.
> >
> > Could you please post the full dmesg output?  That should include a
> > line like
> >
> >  sysfs: duplicate filename 'foobar' can not be created
> >
> > What are the exact commands that you perform (or contents of
> > /etc/fstab, etc. that might be relevant) to tirgger this bug?
> >
> 
> I think you were unable to reproduce it because i just figured out
> that it only occurs on a raid-0 partition managed by dmraid.
> Ex:
> 
> Mounting the non-raid:
> /dev/sdb3           10913       18242    58878225    7  HPFS/NTFS
> root@...-desktop:~# mount /dev/sdb3 /next
> root@...-desktop:~#
> 
> The raid-0:
> /dev/mapper/isw_fjcgajage_raid3            4346       29841
> 204796620    7  HPFS/NTFS
> root@...-desktop:~# mount /dev/mapper/isw_fjcgajage_raid3 /new
> fuse: mount failed: Cannot allocate memory
> 
> NOTE that I've tried mounting other raid-0 NTFS partitions. Same
> failure occurred. So it doesn't seem to be isolated to one partition.
> RAID is the only common thing.
> 
> I've attached the full dmesg. Hope it helps.

Thanks!

The problem seems to be that if a device isn't partitioned (and the
raid-0 device isn't), then fuse will register its own BDI with the
same name as the one belonging to the underlying device.

Here's a patch that should fix it.  Can you please confirm?

Thanks,
Miklos



Subject: fuse: fix bdi naming conflict

From: Miklos Szeredi <mszeredi@...e.cz>

Fuse allocates a separate bdi for each filesystem, and registers them
in sysfs with "MAJOR:MINOR" of sb->s_dev (st_dev).  This works fine
for anon devices normally used by fuse, but can conflict with an
already registered BDI for "fuseblk" filesystems, where sb->s_dev
represents a real block device.  In particularl this happens if a
non-partitioned device is being mounted.

Fix by registering with a different name for "fuseblk" filesystems.

Thanks to Ioan Ionita for the bug report.

Signed-off-by: Miklos Szeredi <mszeredi@...e.cz>
---
 Documentation/ABI/testing/sysfs-class-bdi |    4 ++++
 fs/fuse/inode.c                           |    7 ++++++-
 2 files changed, 10 insertions(+), 1 deletion(-)

Index: linux-2.6/fs/fuse/inode.c
===================================================================
--- linux-2.6.orig/fs/fuse/inode.c	2008-05-16 16:34:31.000000000 +0200
+++ linux-2.6/fs/fuse/inode.c	2008-05-19 20:54:53.000000000 +0200
@@ -488,7 +488,12 @@ static struct fuse_conn *new_conn(struct
 		err = bdi_init(&fc->bdi);
 		if (err)
 			goto error_kfree;
-		err = bdi_register_dev(&fc->bdi, fc->dev);
+		if (sb->s_bdev) {
+			err = bdi_register(&fc->bdi, NULL, "%u:%u-fuseblk",
+					   MAJOR(fc->dev), MINOR(fc->dev));
+		} else {
+			err = bdi_register_dev(&fc->bdi, fc->dev);
+		}
 		if (err)
 			goto error_bdi_destroy;
 		/*
Index: linux-2.6/Documentation/ABI/testing/sysfs-class-bdi
===================================================================
--- linux-2.6.orig/Documentation/ABI/testing/sysfs-class-bdi	2008-05-14 12:48:03.000000000 +0200
+++ linux-2.6/Documentation/ABI/testing/sysfs-class-bdi	2008-05-19 20:59:59.000000000 +0200
@@ -14,6 +14,10 @@ MAJOR:MINOR
 	non-block filesystems which provide their own BDI, such as NFS
 	and FUSE.
 
+MAJOR:MINOR-fuseblk
+
+	Value of st_dev on fuseblk filesystems.
+
 default
 
 	The default backing dev, used for non-block device backed


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ