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]
Date:	Mon, 11 May 2015 18:07:38 +0200
From:	David Sterba <dsterba@...e.cz>
To:	Omar Sandoval <osandov@...ndov.com>
Cc:	Chris Mason <clm@...com>, Josef Bacik <jbacik@...com>,
	David Sterba <dsterba@...e.cz>, linux-btrfs@...r.kernel.org,
	linux-kernel@...r.kernel.org, Qu Wenruo <quwenruo@...fujitsu.com>
Subject: Re: [PATCH v2 1/6] Btrfs: lock superblock before remounting for rw
 subvol

On Thu, Apr 09, 2015 at 02:34:51PM -0700, Omar Sandoval wrote:
> Since commit 0723a0473fb4 ("btrfs: allow mounting btrfs subvolumes with
> different ro/rw options"), when mounting a subvolume read/write when
> another subvolume has previously been mounted read-only, we first do a
> remount. However, this should be done with the superblock locked, as per
> sync_filesystem():
> 
> 	/*
> 	 * We need to be protected against the filesystem going from
> 	 * r/o to r/w or vice versa.
> 	 */
> 	WARN_ON(!rwsem_is_locked(&sb->s_umount));
> 
> This WARN_ON can easily be hit with:
> 
> mkfs.btrfs -f /dev/vdb
> mount /dev/vdb /mnt
> btrfs subvol create /mnt/vol1
> btrfs subvol create /mnt/vol2
> umount /mnt
> mount -oro,subvol=/vol1 /dev/vdb /mnt
> mount -orw,subvol=/vol2 /dev/vdb /mnt2
> 
> Fixes: 0723a0473fb4 ("btrfs: allow mounting btrfs subvolumes with different ro/rw options")
> Signed-off-by: Omar Sandoval <osandov@...ndov.com>

Reviewed-by: David Sterba <dsterba@...e.cz>
--
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