[linux-lvm] lvm fails when /proc/devices contains "-1 smblk"

Zdenek Kabelac zdenek.kabelac at gmail.com
Sat Mar 17 09:46:41 UTC 2012


Dne 16.3.2012 07:28, John Mesmon napsal(a):
> It filters out all the possible devices, resulting in almost all
> operations failing (maybe all, I haven't checked that far).
> 
> Introduced by c929a0b3c8c1cd4a32458b5db0aa3d221a949aad
> 
> My opinion is that there is no need for the check that commit adds, It
> can only break things (when the range of valid block devices changes).

I thin you should made your opinion after checking the code around this check
- since then you would notice, that parsed number is used as an index to
static array and using '-1' obviously makes an access outside of the memory
allocated for this mapping array.

The fact it's used to work before this commit means, that overwritten memory
in front of this array was not that much important for lvm executable.

> For reference, the relavent portion of my /proc/devices:
> 
> Character devices:
>   1 mem
>   4 /dev/vc/0
>   4 tty
> ...
> 251 macvtap
> 252 kcopy
> 253 bsg
> 254 rtc
> 
> Block devices:
>  -1 smblk
>   1 ramdisk
> 256 rfd
> 257 ssfdc
> 259 blkext
>   7 loop

While saying that - we may add support for several majors with negative
numbers, but it somehow doesn't make sense to me yet.
(Since the filter's mapping table supports majors in range  [0..4096> )

If I check kernel headers or glibc headers, then  major & minor numbers
are always handled as unsigned numbers.

So how is that, that your /proc/devices shows it as '-1' ??
What are major/minor numbers of devices that belong to 'smblk' ??

How did you came to such block device ??
Is that actually anything from upstream kernel ??

Zdenek




More information about the linux-lvm mailing list