mirror of
git://sourceware.org/git/lvm2.git
synced 2025-02-22 09:57:47 +03:00
When reading an info about MDAs from lvmetad, we need to use 64 bit int to read the value of the offset/size, otherwise the value is overflows and then it's used throughout! This is dangerous if we're trying to write such metadata area then, mostly visible if we're using 2 mdas where the 2nd one is at the end of the underlying device and hence the value of the mda offset is high enough to cause problems: (the offset trimmed to value of 0 instead of 4096m, so we write at the very start of the disk (or elsewhere if the offset has some other value!) [1] raw/~ # lvcreate -s -l 100%FREE vg --virtualsize 4097m Logical volume "lvol0" created [1] raw/~ # pvcreate --metadatacopies 2 /dev/vg/lvol0 Physical volume "/dev/vg/lvol0" successfully created [1] raw/~ # hexdump -n 512 /dev/vg/lvol0 0000000 0000 0000 0000 0000 0000 0000 0000 0000 * 0000200 [1] raw/~ # pvchange -u /dev/vg/lvol0 Physical volume "/dev/vg/lvol0" changed 1 physical volume changed / 0 physical volumes not changed [1] raw/~ # hexdump -n 512 /dev/vg/lvol0 0000000 d43e d2a5 4c20 4d56 2032 5b78 4135 7225 0000010 4e30 3e2a 0001 0000 0000 0000 0000 0000 0000020 0000 0010 0000 0000 0000 0000 0000 0000 0000030 0000 0000 0000 0000 0000 0000 0000 0000 * 0000200 ======= (the offset overflows to undefined values which is far behind the end of the disk) [1] raw/~ # lvcreate -s -l 100%FREE vg --virtualsize 100g Logical volume "lvol0" created [1] raw/~ # pvcreate --metadatacopies 2 /dev/vg/lvol0 Physical volume "/dev/vg/lvol0" successfully created [1] raw/~ # pvchange -u /dev/vg/lvol0 /dev/vg/lvol0: lseek 18446744073708503040 failed: Invalid argument /dev/vg/lvol0: lseek 18446744073708503040 failed: Invalid argument Failed to store physical volume "/dev/vg/lvol0" 0 physical volumes changed / 1 physical volume not changed
This tree contains the LVM2 and device-mapper tools and libraries. For more information about LVM2 read the changelog in the WHATS_NEW file. Installation instructions are in INSTALL. There is no warranty - see COPYING and COPYING.LIB. Tarballs are available from: ftp://sources.redhat.com/pub/lvm2/ The source code is stored in git: http://git.fedorahosted.org/git/lvm2.git git clone git://git.fedorahosted.org/git/lvm2.git Mailing list for general discussion related to LVM2: linux-lvm@redhat.com Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm Mailing lists for LVM2 development, patches and commits: lvm-devel@redhat.com Subscribe from https://www.redhat.com/mailman/listinfo/linux-lvm lvm2-commits@lists.fedorahosted.org (Read-only archive of commits) Subscribe from https://fedorahosted.org/mailman/listinfo/lvm2-commits Mailing list for device-mapper development, including kernel patches and multipath-tools: dm-devel@redhat.com Subscribe from https://www.redhat.com/mailman/listinfo/dm-devel The source code repository used until 7th June 2012 is accessible here: http://sources.redhat.com/cgi-bin/cvsweb.cgi/LVM2/?cvsroot=lvm2.
Description
Languages
C
75.6%
Shell
18.7%
Python
2.8%
M4
1%
Makefile
0.8%
Other
1%