Bug 523860 - PATCH: fix mdmon segfault
PATCH: fix mdmon segfault
Product: Fedora
Classification: Fedora
Component: mdadm (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Doug Ledford
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-09-16 17:36 EDT by Hans de Goede
Modified: 2009-09-17 07:52 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-09-17 07:52:34 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
PATCH: fix mdmon segfault (437 bytes, patch)
2009-09-16 17:36 EDT, Hans de Goede
no flags Details | Diff

  None (edit)
Description Hans de Goede 2009-09-16 17:36:47 EDT
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.

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