Bug 523860

Summary: PATCH: fix mdmon segfault
Product: [Fedora] Fedora Reporter: Hans de Goede <hdegoede>
Component: mdadmAssignee: Doug Ledford <dledford>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: dan.j.williams, dledford
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-17 11:52:34 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:
Attachments:
Description Flags
PATCH: fix mdmon segfault none

Description Hans de Goede 2009-09-16 21:36:47 UTC
Created attachment 361382 [details]
PATCH: fix mdmon segfault

mdmon was creating a supertype struct with malloc, and thus not necessarily
getting zero-d memory.

This was causing it to segfault when called like this from the initrd:
/sbin/mdmon /proc/mdstat /sysroot

The problem was that  load_super_imsm would get called on the non-zero'd
super struct, whcih in turn calls free_super_imsm, which checks st->sb, which
should be zero but isn't and then starts freeing bogus memory.

The attached patch fixes this by using calloc instead of malloc.

This is a rather big problem as mdmon crashing can cause tasks writing to the
disk to hang forever, see bug 523422.