Bug 1447832

Summary: [abrt] kpartx: set_delimiter(): kpartx killed by SIGSEGV
Product: [Fedora] Fedora Reporter: sedrubal <fedora>
Component: device-mapper-multipathAssignee: Ben Marzinski <bmarzins>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 25CC: agk, bmarzins, heinzm, lvm-team, msnitzer, prajnoha, prockai
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
URL: https://retrace.fedoraproject.org/faf/reports/bthash/8b9900d9e87e18787862f46c43aa3157f4d72907
Whiteboard: abrt_hash:7c9aeaa942cbac975a8c77735b31c10d5f628205;
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1448223 (view as bug list) Environment:
Last Closed: 2017-07-21 22:10:38 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1448223    
Attachments:
Description Flags
File: backtrace
none
File: cgroup
none
File: core_backtrace
none
File: dso_list
none
File: environ
none
File: exploitable
none
File: limits
none
File: maps
none
File: mountinfo
none
File: namespaces
none
File: open_fds
none
File: proc_pid_status
none
File: var_log_messages none

Description sedrubal 2017-05-04 01:47:11 UTC
Version-Release number of selected component:
kpartx-0.4.9-83.fc25

Additional info:
reporter:       libreport-2.8.0
backtrace_rating: 4
cmdline:        kpartx -l /
crash_function: set_delimiter
executable:     /usr/sbin/kpartx
global_pid:     2449
kernel:         4.10.13-200.fc25.x86_64
pkg_fingerprint: 4089 D8F2 FDB1 9C98
pkg_vendor:     Fedora Project
runlevel:       N 5
type:           CCpp
uid:            0

Truncated backtrace:
Thread no. 1 (1 frames)
 #0 set_delimiter at kpartx.c:117

Comment 1 sedrubal 2017-05-04 01:47:21 UTC
Created attachment 1276063 [details]
File: backtrace

Comment 2 sedrubal 2017-05-04 01:47:23 UTC
Created attachment 1276064 [details]
File: cgroup

Comment 3 sedrubal 2017-05-04 01:47:24 UTC
Created attachment 1276065 [details]
File: core_backtrace

Comment 4 sedrubal 2017-05-04 01:47:26 UTC
Created attachment 1276066 [details]
File: dso_list

Comment 5 sedrubal 2017-05-04 01:47:28 UTC
Created attachment 1276067 [details]
File: environ

Comment 6 sedrubal 2017-05-04 01:47:29 UTC
Created attachment 1276068 [details]
File: exploitable

Comment 7 sedrubal 2017-05-04 01:47:31 UTC
Created attachment 1276069 [details]
File: limits

Comment 8 sedrubal 2017-05-04 01:47:34 UTC
Created attachment 1276070 [details]
File: maps

Comment 9 sedrubal 2017-05-04 01:47:36 UTC
Created attachment 1276071 [details]
File: mountinfo

Comment 10 sedrubal 2017-05-04 01:47:38 UTC
Created attachment 1276072 [details]
File: namespaces

Comment 11 sedrubal 2017-05-04 01:47:40 UTC
Created attachment 1276073 [details]
File: open_fds

Comment 12 sedrubal 2017-05-04 01:47:41 UTC
Created attachment 1276074 [details]
File: proc_pid_status

Comment 13 sedrubal 2017-05-04 01:47:43 UTC
Created attachment 1276075 [details]
File: var_log_messages

Comment 14 Ben Marzinski 2017-05-04 20:56:08 UTC
Thanks for the report. This will only happen if you run kpartx on something other than a regular file or a block device. I'll fix it up so that it handles this
gracefully.

Comment 15 Ben Marzinski 2017-07-21 22:10:38 UTC
device-mapper-multipath-0.7.1-4.git847cc43.fc27 has a fix for this. Here's the upstream commit, that got pulled in with the new sources.

commit 3d9102bc0fd51988477fc1aade53be358d1b02aa
Author: Benjamin Marzinski <bmarzins>
Date:   Tue May 9 11:57:04 2017 -0500

    kpartx: fix device checks

    There are a number of issues in the the kpartx device checking code.
    First, it accepts files that are neither regular files or a block device
    nodes (you can run kpartx on character devices or directories, and it
    will treat them as block devices). When trying to figure out the
    basename of a device, the code returns garbage if the path doesn't
    include a '/'. Finally, the set_delimiter code can access memory outside
    of the string if an empty string is passed in.

    Signed-off-by: Benjamin Marzinski <bmarzins>