Bug 1456686 - Use after free bug in parse_imagepath is crashing tcmu-runner
Summary: Use after free bug in parse_imagepath is crashing tcmu-runner
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Gluster Storage
Classification: Red Hat Storage
Component: tcmu-runner
Version: rhgs-3.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: RHGS 3.3.0
Assignee: Pranith Kumar K
QA Contact: Sweta Anandpara
URL:
Whiteboard:
Depends On:
Blocks: 1417151
TreeView+ depends on / blocked
 
Reported: 2017-05-30 07:34 UTC by Pranith Kumar K
Modified: 2017-09-21 04:19 UTC (History)
5 users (show)

Fixed In Version: tcmu-runner-1.2.0-4.el7rhgs
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-09-21 04:19:33 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2017:2773 0 normal SHIPPED_LIVE new packages: gluster-block 2017-09-21 08:16:22 UTC

Description Pranith Kumar K 2017-05-30 07:34:54 UTC
Description of problem:
    This is the asan trace:
    ==1482==ERROR: AddressSanitizer: heap-use-after-free on address 0x60300000db70 at pc 0x7ffff0bfb93f bp 0x7fffffffc830 sp 0x7fffffffc820
    READ of size 8 at 0x60300000db70 thread T0
        #0 0x7ffff0bfb93e in gluster_free_server /root/tcmu-runner/glfs.c:270
        #1 0x7ffff0bfc851 in tcmu_create_glfs_object /root/tcmu-runner/glfs.c:415
        #2 0x7ffff0bfcda3 in tcmu_glfs_open /root/tcmu-runner/glfs.c:503
        #3 0x417ced in dev_added /root/tcmu-runner/main.c:678
        #4 0x7ffff6c12662 in add_device /root/tcmu-runner/libtcmu.c:296
        #5 0x7ffff6c13503 in open_devices /root/tcmu-runner/libtcmu.c:436
        #6 0x7ffff6c13c62 in tcmulib_initialize /root/tcmu-runner/libtcmu.c:477
        #7 0x418720 in main /root/tcmu-runner/main.c:871
        #8 0x7ffff5500400 in __libc_start_main (/lib64/libc.so.6+0x20400)
        #9 0x407dd9 in _start (/root/tcmu-runner/tcmu-runner+0x407dd9)
    
    0x60300000db70 is located 0 bytes inside of 24-byte region [0x60300000db70,0x60300000db88)
    freed by thread T0 here:
        #0 0x7ffff6efbb00 in free (/lib64/libasan.so.3+0xc6b00)
        #1 0x7ffff0bfbaa8 in gluster_free_server /root/tcmu-runner/glfs.c:276
        #2 0x7ffff0bfc336 in parse_imagepath /root/tcmu-runner/glfs.c:347
        #3 0x7ffff0bfc464 in tcmu_create_glfs_object /root/tcmu-runner/glfs.c:360
        #4 0x7ffff0bfcda3 in tcmu_glfs_open /root/tcmu-runner/glfs.c:503
        #5 0x417ced in dev_added /root/tcmu-runner/main.c:678
        #6 0x7ffff6c12662 in add_device /root/tcmu-runner/libtcmu.c:296
        #7 0x7ffff6c13503 in open_devices /root/tcmu-runner/libtcmu.c:436
        #8 0x7ffff6c13c62 in tcmulib_initialize /root/tcmu-runner/libtcmu.c:477
        #9 0x418720 in main /root/tcmu-runner/main.c:871
        #10 0x7ffff5500400 in __libc_start_main (/lib64/libc.so.6+0x20400)
    
    previously allocated by thread T0 here:
        #0 0x7ffff6efc020 in calloc (/lib64/libasan.so.3+0xc7020)
        #1 0x7ffff0bfbbe5 in parse_imagepath /root/tcmu-runner/glfs.c:299
        #2 0x7ffff0bfc464 in tcmu_create_glfs_object /root/tcmu-runner/glfs.c:360
        #3 0x7ffff0bfcda3 in tcmu_glfs_open /root/tcmu-runner/glfs.c:503
        #4 0x417ced in dev_added /root/tcmu-runner/main.c:678
        #5 0x7ffff6c12662 in add_device /root/tcmu-runner/libtcmu.c:296
        #6 0x7ffff6c13503 in open_devices /root/tcmu-runner/libtcmu.c:436
        #7 0x7ffff6c13c62 in tcmulib_initialize /root/tcmu-runner/libtcmu.c:477
        #8 0x418720 in main /root/tcmu-runner/main.c:871
        #9 0x7ffff5500400 in __libc_start_main (/lib64/libc.so.6+0x20400)


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 2 Pranith Kumar K 2017-05-30 07:37:16 UTC
https://github.com/open-iscsi/tcmu-runner/pull/167

Comment 8 Sweta Anandpara 2017-07-17 11:09:28 UTC
A round of testing has taken place on glusterfs-3.8.4-33 and gluster-block-0.2.1-6. I do not see any crashes or something unexpected in gluster-block logs. 

Based on comment7 - developer's inputs as well as release leads' agreement, moving this bug to (conditionally) verified.

Comment 11 errata-xmlrpc 2017-09-21 04:19:33 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-2017:2773


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