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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4DDBC4A7.1040104@fusionio.com>
Date:	Tue, 24 May 2011 16:45:59 +0200
From:	Jens Axboe <jaxboe@...ionio.com>
To:	Namhyung Kim <namhyung@...il.com>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Laurent Vivier <Laurent.Vivier@...l.net>
Subject: Re: [PATCH 2/2] loop: handle on-demand devices correctly

On 2011-05-24 16:36, Namhyung Kim wrote:
> When finding or allocating a loop device, loop_probe() did not take
> partition numbers into account so that it can result to a different
> device. Consider following example:
> 
> $ sudo modprobe loop max_part=15
> $ ls -l /dev/loop*
> brw-rw---- 1 root disk 7,   0 2011-05-24 22:16 /dev/loop0
> brw-rw---- 1 root disk 7,  16 2011-05-24 22:16 /dev/loop1
> brw-rw---- 1 root disk 7,  32 2011-05-24 22:16 /dev/loop2
> brw-rw---- 1 root disk 7,  48 2011-05-24 22:16 /dev/loop3
> brw-rw---- 1 root disk 7,  64 2011-05-24 22:16 /dev/loop4
> brw-rw---- 1 root disk 7,  80 2011-05-24 22:16 /dev/loop5
> brw-rw---- 1 root disk 7,  96 2011-05-24 22:16 /dev/loop6
> brw-rw---- 1 root disk 7, 112 2011-05-24 22:16 /dev/loop7
> $ sudo mknod /dev/loop8 b 7 128
> $ sudo losetup /dev/loop8 ~/temp/disk-with-3-parts.img
> $ sudo losetup -a
> /dev/loop128: [0805]:278201 (/home/namhyung/temp/disk-with-3-parts.img)
> $ ls -l /dev/loop*
> brw-rw---- 1 root disk 7,    0 2011-05-24 22:16 /dev/loop0
> brw-rw---- 1 root disk 7,   16 2011-05-24 22:16 /dev/loop1
> brw-rw---- 1 root disk 7, 2048 2011-05-24 22:18 /dev/loop128
> brw-rw---- 1 root disk 7, 2049 2011-05-24 22:18 /dev/loop128p1
> brw-rw---- 1 root disk 7, 2050 2011-05-24 22:18 /dev/loop128p2
> brw-rw---- 1 root disk 7, 2051 2011-05-24 22:18 /dev/loop128p3
> brw-rw---- 1 root disk 7,   32 2011-05-24 22:16 /dev/loop2
> brw-rw---- 1 root disk 7,   48 2011-05-24 22:16 /dev/loop3
> brw-rw---- 1 root disk 7,   64 2011-05-24 22:16 /dev/loop4
> brw-rw---- 1 root disk 7,   80 2011-05-24 22:16 /dev/loop5
> brw-rw---- 1 root disk 7,   96 2011-05-24 22:16 /dev/loop6
> brw-rw---- 1 root disk 7,  112 2011-05-24 22:16 /dev/loop7
> brw-r--r-- 1 root root 7,  128 2011-05-24 22:17 /dev/loop8
> 
> After this patch, /dev/loop8 - instead of /dev/loop128 - was
> accessed correctly.
> 
> In addition, 'range' passed to blk_register_region() should
> include all range of dev_t that LOOP_MAJOR can address. It does
> not need to be limited by partition numbers unless 'max_loop'
> param was specified.

Thanks, applied. Seems we should mark this for stable.

-- 
Jens Axboe

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