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>] [day] [month] [year] [list]
Message-ID: <1280480383.1851.2.camel@yio.site>
Date:	Fri, 30 Jul 2010 10:59:43 +0200
From:	Kay Sievers <kay.sievers@...y.org>
To:	Jens Axboe <axboe@...nel.dk>
Cc:	linux-kernel <linux-kernel@...r.kernel.org>,
	Karel Zak <kzak@...hat.com>
Subject: [PATCH] block: move blk_register_queue() before uevent is send out

From: Kay Sievers <kay.sievers@...y.org>
Subject: block: move blk_register_queue() before uevent is send out

Sysfs attributes should be created before the device is announced to
userspace. Createing attributes after the event makes it impossible
to use them reliably from udev.

The issue was found by Karel.

Cc: Karel Zak <kzak@...hat.com>
Signed-Off-By: Kay Sievers <kay.sievers@...y.org>
---
 block/genhd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/block/genhd.c
+++ b/block/genhd.c
@@ -531,6 +531,7 @@ static void register_disk(struct gendisk
 #endif
 	disk->part0.holder_dir = kobject_create_and_add("holders", &ddev->kobj);
 	disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj);
+	blk_register_queue(disk);
 
 	/* No minors to use for partitions */
 	if (!disk_partitionable(disk))
@@ -602,7 +603,6 @@ void add_disk(struct gendisk *disk)
 	blk_register_region(disk_devt(disk), disk->minors, NULL,
 			    exact_match, exact_lock, disk);
 	register_disk(disk);
-	blk_register_queue(disk);
 
 	bdi = &disk->queue->backing_dev_info;
 	bdi_register_dev(bdi, disk_devt(disk));


--
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