1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-11 09:18:25 +03:00
lvm2/test
Zdenek Kabelac 91419c3e86 Fix use of released vgname and vgid
Avoid using of already released memory when duplicated MDA is found.

As get_pv_from_vg_by_id() may call lvmcache_label_scan() use the local copy
of the vgname and vgid on the stack as vginfo may dissapear and code was
then accessing garbage in memory.

i.e.  pvs  /dev/loop0
(when /dev/loop0 and /dev/loop1 has same MDA content)

Invalid read of size 1
   at 0x523C986: dm_hash_lookup (hash.c:325)
   by 0x440C8C: vginfo_from_vgname (lvmcache.c:399)
   by 0x4605C0: _create_vg_text_instance (format-text.c:1882)
   by 0x46140D: _text_create_text_instance (format-text.c:2243)
   by 0x47EB49: _vg_read (metadata.c:2887)
   by 0x47FBD8: vg_read_internal (metadata.c:3231)
   by 0x477594: get_pv_from_vg_by_id (metadata.c:344)
   by 0x45F07A: _get_pv_if_in_vg (format-text.c:1400)
   by 0x45F0B9: _populate_pv_fields (format-text.c:1414)
   by 0x45F40F: _text_pv_read (format-text.c:1493)
   by 0x480431: _pv_read (metadata.c:3500)
   by 0x4802B2: pv_read (metadata.c:3462)
 Address 0x652ab80 is 0 bytes inside a block of size 4 free'd
   at 0x4C2756E: free (vg_replace_malloc.c:366)
   by 0x442277: _free_vginfo (lvmcache.c:963)
   by 0x44235E: _drop_vginfo (lvmcache.c:992)
   by 0x442B23: _lvmcache_update_vgname (lvmcache.c:1165)
   by 0x443449: lvmcache_update_vgname_and_id (lvmcache.c:1358)
   by 0x443C07: lvmcache_add (lvmcache.c:1492)
   by 0x46588C: _text_read (text_label.c:271)
   by 0x466A65: label_read (label.c:289)
   by 0x4413FC: lvmcache_label_scan (lvmcache.c:635)
   by 0x4605AD: _create_vg_text_instance (format-text.c:1881)
   by 0x46140D: _text_create_text_instance (format-text.c:2243)
   by 0x47EB49: _vg_read (metadata.c:2887)

Add testing script
2011-04-21 13:13:40 +00:00
..
api This patchset refactors some reporting code and completes the remaining 2011-04-12 12:24:29 +00:00
lib Make the mirror log checks in t-lvconvert-repair-policy a bit more strict 2011-04-12 12:39:24 +00:00
.gitignore Add testing framework, along with first few tests. 2007-09-18 14:00:42 +00:00
Makefile.in Always copy all tests to builddir regardless of T/S, since subsequent runs 2011-04-19 15:28:17 +00:00
t-000-basic.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-activate-missing.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-activate-partial.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-covercmd.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-dmeventd-restart.sh As requested in BZ 454618: 2011-03-02 12:49:13 +00:00
t-fsadm.sh Skip sysinit test for cluster 2011-01-31 22:05:30 +00:00
t-inconsistent-metadata.sh Lower disk space usage of inconsistent mda test 2011-01-28 16:13:39 +00:00
t-listings.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-lock-blocking.sh Make the lock test a little bit better... 2011-03-04 15:04:08 +00:00
t-lvchange-mirror.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-lvconvert-mirror-basic-0.sh add copyright notices to new files 2010-07-28 12:20:38 +00:00
t-lvconvert-mirror-basic-1.sh add copyright notices to new files 2010-07-28 12:20:38 +00:00
t-lvconvert-mirror-basic-2.sh add copyright notices to new files 2010-07-28 12:20:38 +00:00
t-lvconvert-mirror-basic-3.sh add copyright notices to new files 2010-07-28 12:20:38 +00:00
t-lvconvert-mirror-basic.sh Do not echo y to lvconvert 2011-03-03 12:30:33 +00:00
t-lvconvert-mirror.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-lvconvert-repair-dmeventd.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-lvconvert-repair-policy.sh Make the mirror log checks in t-lvconvert-repair-policy a bit more strict 2011-04-12 12:39:24 +00:00
t-lvconvert-repair-replace.sh Use backward compatible configuration for test 2011-02-28 19:44:21 +00:00
t-lvconvert-repair-snapshot.sh Use backward compatible configuration for test 2011-02-28 19:44:21 +00:00
t-lvconvert-repair-transient-dmeventd.sh Add a test for the interaction of transient errors and dmeventd mirror repair. 2011-01-07 14:56:10 +00:00
t-lvconvert-repair-transient.sh Re-enable t-lvconvert-repair-transient, avoiding the deadlock by running mkfs 2011-01-05 14:15:01 +00:00
t-lvconvert-repair.sh Use backward compatible configuration for test 2011-02-28 19:44:21 +00:00
t-lvconvert-twostep.sh Add disk to mirrored log type conversion. 2011-01-11 17:05:08 +00:00
t-lvcreate-mirror.sh Use backward compatible configuration for test 2011-02-28 19:44:21 +00:00
t-lvcreate-operation.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-lvcreate-pvtags.sh Use backward compatible configuration for test 2011-02-28 19:44:21 +00:00
t-lvcreate-small-snap.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-lvcreate-usage.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-lvextend-percent-extents.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-lvextend-snapshot-dmeventd.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-lvextend-snapshot-policy.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-lvm-init.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-lvmcache-exercise.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-lvresize-mirror.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-lvresize-usage.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-mdata-strings.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-metadata-balance.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-metadata-dirs.sh Add a test for RHBZ 640621 (metadata/dirs + no PV MDAs broken). 2011-01-05 01:00:34 +00:00
t-metadata.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-mirror-names.sh Testing: remove -q from grep 2011-03-30 13:39:24 +00:00
t-mirror-vgreduce-removemissing.sh Testing: remove -q from grep 2011-03-30 13:39:24 +00:00
t-nomda-missing.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-pool-labels.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-pv-duplicate.sh Fix use of released vgname and vgid 2011-04-21 13:13:40 +00:00
t-pv-min-size.sh Replace PV_MIN_SIZE with function pv_min_size() 2011-02-18 14:11:22 +00:00
t-pv-range-overflow.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-pvchange-usage.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-pvcreate-metadata0.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-pvcreate-operation-md.sh Replacei sleep wait with udev settle 2011-01-28 16:12:45 +00:00
t-pvcreate-operation.sh Testing: remove -q from grep 2011-03-30 13:39:24 +00:00
t-pvcreate-usage.sh Fix test for 8k page (fails on Sparc architecture). 2011-03-06 18:28:09 +00:00
t-pvmove-basic.sh Lower device size of pvmove test 2011-01-28 16:15:08 +00:00
t-pvremove-usage.sh Fix test, "echo n" is not needed when -y is specified. 2011-03-03 14:16:08 +00:00
t-read-ahead.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-snapshot-autoumount-dmeventd.sh Fix test to use explicit /dev/mapper/ node, /proc/mounts should not change this... 2011-03-02 13:49:29 +00:00
t-snapshot-merge.sh Testing: remove -q from grep 2011-03-30 13:39:24 +00:00
t-snapshots-of-mirrors.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-tags.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-test-partition.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-topology-support.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-unknown-segment.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-unlost-pv.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-vgcfgbackup-usage.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-vgchange-maxlv.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-vgchange-sysinit.sh Skip sysinit test for cluster 2011-01-31 22:05:30 +00:00
t-vgchange-usage.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-vgcreate-usage.sh Testing: remove -q from grep 2011-03-30 13:39:24 +00:00
t-vgextend-restoremissing.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-vgextend-usage.sh Testing: remove -q from grep 2011-03-30 13:39:24 +00:00
t-vgmerge-operation.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-vgmerge-usage.sh Reduce amount of vgremove and vgchange calls 2011-03-28 11:35:20 +00:00
t-vgreduce-usage.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-vgrename-usage.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-vgsplit-operation.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-vgsplit-stacked.sh Substantial rework of the functional test support code. Some new features: 2011-01-05 00:16:18 +00:00
t-vgsplit-usage.sh Reduce amount of vgremove and vgchange calls 2011-03-28 11:35:20 +00:00