Bug 94381
Summary: | NULL pointer deref in raid5_free | ||
---|---|---|---|
Product: | IO/Storage | Reporter: | Richard W.M. Jones (rjones) |
Component: | MD | Assignee: | Neil Brown (neilb) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | neilb |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | linux from git | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: |
tarball containing compressed faulty RAID images
Full log of boot failure patch |
Description
Richard W.M. Jones
2015-03-06 08:53:59 UTC
FWIW, same backtrace with git://neil.brown.name/md for-next branch. This patch is one possible way to fix it. I have tested it and it fixes the bug for me. Other possibilities include changing free_conf so that it can be called with a NULL pointer, or changing raid5_free so it doesn't call free_conf when conf==NULL. diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index dab908b..06e93ba 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -6307,8 +6307,6 @@ static int run(struct mddev *mddev) abort: md_unregister_thread(&mddev->thread); print_raid5_conf(conf); - free_conf(conf); - mddev->private = NULL; printk(KERN_ALERT "md/raid:%s: failed to run raid set.\n", mdname(mddev)); return -EIO; } Created attachment 169531 [details]
Full log of boot failure
Just FYI here is the full goot log of the failure, with the
current upstream linux from git.
Created attachment 170551 [details]
patch
Thanks for the report.
I think this patch is the best fix.
Could you please test and confirm that it works for you?
Yes the patch in comment 4 also fixes it. You can add: Tested-by: Richard W.M. Jones <rjones@redhat.com> FWIW with the patch, the error message is: [ 3.034287] md/raid:md123: not clean -- starting background reconstruction [ 3.038205] md/raid:md123: device sdc3 operational as raid disk 0 [ 3.043332] md/raid:md123: allocated 0kB [ 3.044813] md/raid:md123: cannot start dirty degraded array. [ 3.048098] md/raid:md123: failed to run raid set. [ 3.049906] md: pers->run() failed ... mdadm: failed to RUN_ARRAY /dev/md/r5t3: Input/output error mdadm: Not enough devices to start the array while not clean - consider --force. and there is no oops. I'm closing this because the patch has gone into Linus's tree now (commit 0c35bd4723e4a39ba2da4c13a22cb97986ee10c8). |