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: <20110122142303.GD6160@htj.dyndns.org>
Date:	Sat, 22 Jan 2011 15:23:03 +0100
From:	Tejun Heo <tj@...nel.org>
To:	Jens Axboe <axboe@...nel.dk>,
	"J. R. Okajima" <hooanon05@...oo.co.jp>
Cc:	David Brownell <dbrownell@...rs.sourceforge.net>,
	linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
	Al Viro <viro@...iv.linux.org.uk>
Subject: [PATCH 2/2] block: clear ro on fd detach fd is bound

Commit 75f1dc0d (block: check bdev_read_only() from blkdev_get())
enforced bdev_read_only() check during blkdev_get().  This had an
unfortunate side effect on loop because loop didn't clear ro flag on
fd detach, so once a loop device was used ro, it can't be used for rw
at all.

Fix it by clearing ro flag on fd detach.

Signed-off-by: Tejun Heo <tj@...nel.org>
Reported-by: "J. R. Okajima" <hooanon05@...oo.co.jp>
---
 drivers/block/loop.c |    1 +
 1 file changed, 1 insertion(+)

Index: work/drivers/block/loop.c
===================================================================
--- work.orig/drivers/block/loop.c
+++ work/drivers/block/loop.c
@@ -1041,6 +1041,7 @@ static int loop_clr_fd(struct loop_devic
 	set_capacity(lo->lo_disk, 0);
 	loop_sysfs_exit(lo);
 	bd_set_size(bdev, 0);
+	set_device_ro(bdev, 0);
 	/* let user-space know about this change */
 	kobject_uevent(&disk_to_dev(bdev->bd_disk)->kobj, KOBJ_CHANGE);
 	mapping_set_gfp_mask(filp->f_mapping, gfp);
--
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