Bug 504312 - Several lvm2 commands can segfault during repairing inconsistent metadata
Several lvm2 commands can segfault during repairing inconsistent metadata
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: lvm2 (Show other bugs)
5.4
All Linux
high Severity high
: rc
: ---
Assigned To: Milan Broz
Cluster QE
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-06-05 10:36 EDT by Milan Broz
Modified: 2013-02-28 23:07 EST (History)
11 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-09-02 07:56:49 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Milan Broz 2009-06-05 10:36:09 EDT
Description of problem:

Some lvm2 commands tries to repair inconsistent metadata (vgchange, vgconvert, vgscan).

Current code incorectly releases old volume group metadata twice from memory, causeing commands segfault of glibc warnings:


# vgscan
  Reading all physical volumes.  This may take a while...
  Volume group "vg_test" inconsistent
  WARNING: Inconsistent metadata found for VG vg_test - updating to use version 3
  Removing PV /dev/mapper/x (1nxHIW-2Thk-9mS4-2TzO-zHlB-Hsy2-CZsjE7) that no longer belongs to VG vg_test
  Found volume group "vg_test" using metadata type lvm2
Segmentation fault

OR

# vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "vg_rhel4" using metadata type lvm2 
  Found volume group "myvg" using metadata type lvm2     
  Volume group "vg_test" inconsistent                    
  WARNING: Inconsistent metadata found for VG vg_test - updating to use version 4
  Removing PV /dev/mapper/x (T5Fj1R-fvs6-9UZG-oaix-Fmtz-WybW-bhyJ37) that no longer belongs to VG vg_test                                                                         
  Found volume group "vg_test" using metadata type lvm2                                  
*** glibc detected *** vgscan: double free or corruption (out): 0x006d54c0 ***           
======= Backtrace: =========                                                             
/lib/libc.so.6[0x5fd0f1]                                                                 
/lib/libc.so.6(cfree+0x90)[0x600bc0]                                                     
/lib/libdevmapper.so.1.02(dm_pool_destroy+0x22)[0x4a6da2]                                
vgscan(vg_release+0x34)[0x80a1624]                                                       
vgscan[0x806bc1b]                                                                        
vgscan(process_each_vg+0x12c)[0x806c83c]                                                 
vgscan(vgscan+0x12c)[0x807389c]                                                          
vgscan(lvm_run_command+0xf18)[0x805f3d8]                                                 
vgscan(lvm2_main+0x4ca)[0x805fa2a]                                                       
vgscan(main+0x32)[0x8075422]                                                             
/lib/libc.so.6(__libc_start_main+0xdc [0x5a9e8c]                                         
vgscan[0x80528c1]                                                                        
...

Version-Release number of selected component (if applicable):
# rpm -q lvm2
lvm2-2.02.46-3.el5

This is regression, patch (in review) is available.
Comment 4 Milan Broz 2009-06-06 17:25:47 EDT
Fixed in lvm2-2.02.46-5.el5.
Comment 7 Corey Marthaler 2009-07-07 16:50:45 EDT
Ran the script provided in comment #1 and didn't see a segfault, marking verified in lvm2-2.02.46-8.el5.
Comment 9 errata-xmlrpc 2009-09-02 07:56:49 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-1393.html

Note You need to log in before you can comment on or make changes to this bug.