diff options
author | NeilBrown <neilb@suse.de> | 2010-12-09 17:02:14 +1100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-01-07 13:58:33 -0800 |
commit | ccbfc7594abfb470ab719da568e8bbd4265a888d (patch) | |
tree | 8131bb434ee9da98d0c4fd772a834c679b740561 /kernel | |
parent | 51e1adf0beb67766cddab3be2ae78c7787768693 (diff) |
md: protect against NULL reference when waiting to start a raid10.
commit 589a594be1fb8815b3f18e517be696c48664f728 upstream.
When we fail to start a raid10 for some reason, we call
md_unregister_thread to kill the thread that was created.
Unfortunately md_thread() will then make one call into the handler
(raid10d) even though md_wakeup_thread has not been called. This is
not safe and as md_unregister_thread is called after mddev->private
has been set to NULL, it will definitely cause a NULL dereference.
So fix this at both ends:
- md_thread should only call the handler if THREAD_WAKEUP has been
set.
- raid10 should call md_unregister_thread before setting things
to NULL just like all the other raid modules do.
This is applicable to 2.6.35 and later.
Reported-by: "Citizen" <citizen_lee@thecus.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel')
0 files changed, 0 insertions, 0 deletions