Fix a potential NULL dereference in md/raid1
patch for 2.6.16 stable series
My applogies to people reading this with a window narrower than 111 characters :-(
NeilBrown
### Comments for Changeset
At the point where this 'atomic_add' is, rdev could be NULL, as seen by the fact that we test for this in the very next statement.
Further is it is really the wrong place of the add. We could add to the count of corrected errors
once the are sure it was corrected, not before trying to correct it.
### Diffstat output
./drivers/md/raid1.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/md/raid1.c +3 -1
@@ -1467,7 +1467,6 @@ static void raid1d(mddev_t *mddev) d = conf->raid_disks; d--; rdev = conf->mirrors[d].rdev; -atomic_add (s, &rdev->corrected_errors);if (rdev &&test_bit (In_sync, &rdev->flags)) { if (sync_page_io(rdev->bdev,
@@ -1490,6 +1489,9 @@ static void raid1d(mddev_t *mddev) s<<9, conf->tmppage, READ) == 0)/* Well, this device is dead */ md_error (mddev, rdev); + else + atomic_add(s, &rdev->corrected_errors); + } } }else {
Quoted 2 lines · NeilBrown
patch for 2.6.16 stable series
...
Thanks for this patch.
It does also apply against both 2.6.17.9 and Linus' tree.
Is it not required in these trees, or are you also submitting it there?
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedQuoted 10 lines · On Monday August 21, [email protected] wrote:
Quoted 2 lines · NeilBrown
patch for 2.6.16 stable series
...Thanks for this patch.
It does also apply against both 2.6.17.9 and Linus' tree.
Is it not required in these trees, or are you also submitting it there?
I've just sent a patch to [email protected] for 2.6.17.9. (it is the same patch with slightly different line numbers).
The patch for -linus is quite different and will follow shortly (with a few other patches).
Thanks,
NeilBrown
Quoted 10 lines · Neil Brown
Quoted 9 lines · On Monday August 21, [email protected] wrote:
Quoted 2 lines · NeilBrown
patch for 2.6.16 stable series
...Thanks for this patch.
It does also apply against both 2.6.17.9 and Linus' tree.
Quoted 7 lines
Quoted 1 line
Is it not required in these trees, or are you also submitting it there?
I've just sent a patch to [email protected] for 2.6.17.9. (it is the same patch with slightly different line numbers).
The patch for -linus is quite different and will follow shortly (with a few other patches).
OK, I'll apply this patch when it has successfully passed 2.6.17 review and got included in 2.6.17.
Quoted 2 lines
Thanks,
NeilBrown
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon SeedAdrian Bunk
AppliedQuoted 13 lines · Adrian Bunk
Quoted 12 lines · Neil Brown
Quoted 10 lines · On Monday August 21, [email protected] wrote:
Quoted 2 lines · NeilBrown
patch for 2.6.16 stable series
...Thanks for this patch.
It does also apply against both 2.6.17.9 and Linus' tree.
Is it not required in these trees, or are you also submitting it there?
Quoted 8 lines
Quoted 5 lines
I've just sent a patch to [email protected] for 2.6.17.9. (it is the same patch with slightly different line numbers).
The patch for -linus is quite different and will follow shortly (with a few other patches).
OK, I'll apply this patch when it has successfully passed 2.6.17 review and got included in 2.6.17.
Applied, thanks for the patch.
cu
Adrian
Signature · 4 lines
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed