Bug 1746593

Summary: vgremove segfault Volume group name "foo[" has invalid characters.
Product: Red Hat Enterprise Linux 8 Reporter: Corey Marthaler <cmarthal>
Component: lvm2Assignee: David Teigland <teigland>
lvm2 sub component: Command-line tools QA Contact: cluster-qe <cluster-qe>
Status: CLOSED ERRATA Docs Contact:
Severity: low    
Priority: high CC: agk, Akanksha.Pandey1, apathaka, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, rbednar, rhandlin, thornber, troy.engel, zkabelac
Version: 8.1   
Target Milestone: rc   
Target Release: 8.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: lvm2-2.03.07-1.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-28 16:58:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Corey Marthaler 2019-08-28 21:20:38 UTC
Description of problem:
[root@hayes-02 ~]# vgremove foo[
  Volume group name "foo[" has invalid characters.
Segmentation fault (core dumped)

Aug 28 16:13:50 hayes-02 kernel: vgremove[8770]: segfault at e0 ip 00005587c3afddd1 sp 00007ffd39eea0c0 error 4 in lvm[5587c39fd000+20f000]
Aug 28 16:13:50 hayes-02 kernel: Code: ff ff 48 8b 1b 83 f8 01 83 dd ff 4c 39 e3 75 e9 89 e8 5b 5d 41 5c c3 66 90 f3 0f 1e fa 41 54 4c 8d a7 e0 00 00 00 55 31 ed 53 <48> 8b 9f e0 00 00 00 4c 39 e39
Aug 28 16:13:50 hayes-02 systemd[1]: Started Process Core Dump (PID 8773/UID 0).
Aug 28 16:13:50 hayes-02 systemd-coredump[8774]: Process 8770 (vgremove) of user 0 dumped core.#012#012Stack trace of thread 8770:#012#0  0x00005587c3afddd1 vg_visible_lvs (lvm)#012#1  0x00005587c)



Version-Release number of selected component (if applicable):
kernel-4.18.0-139.el8    BUILT: Tue Aug 27 17:11:00 CDT 2019
lvm2-2.03.05-4.el8    BUILT: Sun Aug 18 11:44:11 CDT 2019
lvm2-libs-2.03.05-4.el8    BUILT: Sun Aug 18 11:44:11 CDT 2019
lvm2-dbusd-2.03.05-4.el8    BUILT: Sun Aug 18 11:46:32 CDT 2019
lvm2-lockd-2.03.05-4.el8    BUILT: Sun Aug 18 11:44:11 CDT 2019


How reproducible:
Everytime

Comment 1 Corey Marthaler 2019-08-29 13:44:09 UTC
This didn't exist in 7.7.

[root@mckinley-03 ~]# vgremove foo[
  Volume group name "foo[" has invalid characters.
  Cannot process volume group foo[

3.10.0-1058.el7.x86_64
lvm2-2.02.185-2.el7    BUILT: Fri Jun 21 04:18:48 CDT 2019
lvm2-libs-2.02.185-2.el7    BUILT: Fri Jun 21 04:18:48 CDT 2019
lvm2-cluster-2.02.185-2.el7    BUILT: Fri Jun 21 04:18:48 CDT 2019

Comment 2 David Teigland 2019-08-29 16:49:31 UTC
simple fix pushed to master branch:
https://sourceware.org/git/?p=lvm2.git;a=commit;h=7cfbf3a394c2663fbeed17705320b83e69781720

fix segfault for invalid characters in vg name

Fixes a regression from commit ba7ff96faff0
"improve reading and repairing vg metadata"

where the error path for a vg name with invalid
charaters was missing an error flag, which led
to the caller not recognizing an error occured.
Previously, an error flag was hidden in the old
_vg_make_handle function.

Comment 4 Marian Csontos 2019-11-08 09:06:08 UTC
*** Bug 1769713 has been marked as a duplicate of this bug. ***

Comment 6 Corey Marthaler 2019-12-03 20:14:38 UTC
Fix verified in the latest rpms.

kernel-4.18.0-151.el8    BUILT: Fri Nov 15 13:14:53 CST 2019
lvm2-2.03.07-1.el8    BUILT: Mon Dec  2 00:09:32 CST 2019
lvm2-libs-2.03.07-1.el8    BUILT: Mon Dec  2 00:09:32 CST 2019
lvm2-dbusd-2.03.07-1.el8    BUILT: Mon Dec  2 00:12:23 CST 2019
lvm2-lockd-2.03.07-1.el8    BUILT: Mon Dec  2 00:09:32 CST 2019
device-mapper-1.02.167-1.el8    BUILT: Mon Dec  2 00:09:32 CST 2019
device-mapper-libs-1.02.167-1.el8    BUILT: Mon Dec  2 00:09:32 CST 2019
device-mapper-event-1.02.167-1.el8    BUILT: Mon Dec  2 00:09:32 CST 2019
device-mapper-event-libs-1.02.167-1.el8    BUILT: Mon Dec  2 00:09:32 CST 2019
device-mapper-persistent-data-0.8.5-2.el8    BUILT: Wed Jun  5 10:28:04 CDT 2019


[root@hayes-02 ~]# vgremove foo[
  Volume group name "foo[" has invalid characters.
  Cannot process volume group foo[

[root@hayes-02 ~]# vgchange -an test[
  Volume group name "test[" has invalid characters.
  Cannot process volume group test[

Comment 8 errata-xmlrpc 2020-04-28 16:58:57 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2020:1881