Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1476769 - segmentation fault when running thin_rmap from bad file [NEEDINFO]
segmentation fault when running thin_rmap from bad file
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: device-mapper-persistent-data (Show other bugs)
7.4
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: Joe Thornber
Jakub Krysl
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-07-31 08:16 EDT by Jakub Krysl
Modified: 2018-04-10 09:18 EDT (History)
6 users (show)

See Also:
Fixed In Version: device-mapper-persistent-data-0.7.3-1.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-04-10 09:17:29 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
jkrysl: needinfo? (thornber)


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0776 None None None 2018-04-10 09:18 EDT

  None (edit)
Description Jakub Krysl 2017-07-31 08:16:49 EDT
Description of problem:
Running thin_rmap from file that won't pass thin_check (block out of bounds) leads to segmentation fault. This file can even be random existing one.

[root@storageqe-21 thin]# thin_check /tmp/metadata_repair 
examining superblock
examining devices tree
examining mapping tree
checking space map counts
[root@storageqe-21 thin]# thin_rmap --region 0..-1 /tmp/metadata_repair 
data 0..3 -> thin(1) 0..3
data 3..19 -> thin(1) 8..24
data 19..20 -> thin(1) 128..129
data 20..21 -> thin(1) 191..192
data 21..24 -> thin(2) 0..3
data 24..40 -> thin(2) 8..24
data 40..41 -> thin(2) 128..129
data 41..42 -> thin(2) 191..192
data 42..45 -> thin(3) 0..3
data 45..61 -> thin(3) 8..24
data 61..62 -> thin(3) 128..129
data 62..63 -> thin(3) 191..192
data 63..66 -> thin(4) 0..3
data 66..82 -> thin(4) 8..24
data 82..83 -> thin(4) 128..129
data 83..84 -> thin(4) 191..192
data 84..87 -> thin(5) 0..3
data 87..103 -> thin(5) 8..24
data 103..104 -> thin(5) 128..129
data 104..105 -> thin(5) 191..192
data 105..108 -> thin(6) 0..3
data 108..124 -> thin(6) 8..24
data 124..125 -> thin(6) 128..129
data 125..126 -> thin(6) 191..192
data 126..129 -> thin(7) 0..3
data 129..145 -> thin(7) 8..24
data 145..146 -> thin(7) 128..129
data 146..147 -> thin(7) 191..192
data 147..150 -> thin(8) 0..3
data 150..166 -> thin(8) 8..24
data 166..167 -> thin(8) 128..129
data 167..168 -> thin(8) 191..192
data 168..171 -> thin(9) 0..3
data 171..187 -> thin(9) 8..24
data 187..188 -> thin(9) 128..129
data 188..189 -> thin(9) 191..192
data 189..192 -> thin(10) 0..3
data 192..208 -> thin(10) 8..24
data 208..209 -> thin(10) 128..129
data 209..210 -> thin(10) 191..192
[root@storageqe-21 thin]# thin_rmap --region 0..-1 /tmp/metadata
Segmentation fault (core dumped)
[root@storageqe-21 thin]# thin_check /tmp/metadata
examining superblock
  superblock is corrupt
    block out of bounds (0 >= 0)

Version-Release number of selected component (if applicable):
device-mapper-persistent-data-0.7.0-0.1.rc6.el7

How reproducible:
100%

Steps to Reproduce:
1.thin_rmap $RANDOM_EXISTING_FILE

Actual results:
Segmentation fault (core dumped)

Expected results:
warning saying wrong metadata

Additional info:
Comment 4 Jakub Krysl 2017-10-09 10:36:03 EDT
The segmentation fault itself is fixed in device-mapper-persistent-data-0.7.3-1.el7, but it is missing newline at the end of "Metadata is not large enough for superblock.".

# thin_check PURPOSE 
Metadata device/file too small.  Is this binary metadata?
# thin_rmap --region 0..-1 PURPOSE 
Metadata is not large enough for superblock.# thin_rmap --region 0..-1 PURPOSE 
Metadata is not large enough for superblock.# 

Joe, should I create a new BZ for the missing newline char or can you fix it in this one? Thanks
Comment 5 Jakub Krysl 2018-02-22 04:07:43 EST
Setting to verified as that is too minor issue to prevent it.
Comment 8 errata-xmlrpc 2018-04-10 09:17:29 EDT
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-2018:0776

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