From: Zdenek Kabelac <zdenek.kabelac@gmail.com>
To: LVM general discussion and development <linux-lvm@redhat.com>
Cc: John Mesmon <jmesmon@gmail.com>
Subject: Re: [linux-lvm] lvm fails when /proc/devices contains "-1 smblk"
Date: Sat, 17 Mar 2012 10:46:41 +0100 [thread overview]
Message-ID: <4F645D81.3010002@redhat.com> (raw)
In-Reply-To: <CA+6TzyL_vM717b7Atw+Y9zN4tHeAqoisYmTwUAmJxPeB+zzv1w@mail.gmail.com>
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
next prev parent reply other threads:[~2012-03-17 9:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-16 6:28 [linux-lvm] lvm fails when /proc/devices contains "-1 smblk" John Mesmon
2012-03-17 9:46 ` Zdenek Kabelac [this message]
2012-03-17 16:12 ` Alasdair G Kergon
2012-03-17 17:31 ` Maxim Levitsky
2012-03-17 20:51 ` Zdenek Kabelac
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4F645D81.3010002@redhat.com \
--to=zdenek.kabelac@gmail.com \
--cc=jmesmon@gmail.com \
--cc=linux-lvm@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).