]> git.ipfire.org Git - thirdparty/mdadm.git/commit
mdmon: fix freeing unallocated memory
authorHans de Goede <hdegoede@redhat.com>
Thu, 24 Sep 2009 13:52:06 +0000 (06:52 -0700)
committerDan Williams <dan.j.williams@intel.com>
Thu, 24 Sep 2009 13:52:06 +0000 (06:52 -0700)
commitf5df5d69a78b03b7c843e3642725381fc9c76b95
tree5be2901b4ae6f3a9e5e02a512d5ab85ca29a07c8
parentcf53434e5ca40f169afb8064b90bdd6bd7987f28
mdmon: fix freeing unallocated memory

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.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
mdmon.c