cciss: fix cciss_revalidate panic.
PATCH 1/1 cciss: fix cciss_revalidate panic.
From: Stephen M. Cameron <StephenM.Cameron>
If you delete a logical drive, and then run BLKRRPART (e.g. via fdisk) on a logical drive which is "after" the deleted logical drive in the h->drv[] array, then cciss_revalidate panics because it will access the null pointer h->drv[x] when x hits the deleted drive.
--- drivers/block/cciss.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/block/cciss.c +2 -0
@@ -2834,6 +2834,8 @@ static int cciss_revalidate(struct gendisk *disk)InquiryData_struct *inq_buff =NULL ;for (logvol =0 ; logvol <CISS_MAX_LUN ; logvol++) { +if (!h->drv[logvol]) +continue ;if (memcmp (h->drv[logvol]->LunID, drv->LunID,sizeof (drv->LunID)) ==0 ) {FOUND =1 ;
Jens Axboe
maintainerQuoted 6 lines · Stephen M. Cameron
From: Stephen M. Cameron <StephenM.Cameron>
If you delete a logical drive, and then run BLKRRPART (e.g. via fdisk) on a logical drive which is "after" the deleted logical drive in the h->drv[] array, then
cciss_revalidatepanics because it will access the null pointer h->drv[x] when x hits the deleted drive.
Thanks Stephen. I put this in for-linus for 2.6.37 and marked it for stable backport.
Signature · 1 line
Jens Axboe
Quoted 10 lines · Jens Axboe
Quoted 6 lines · Stephen M. Cameron
From: Stephen M. Cameron <StephenM.Cameron>
If you delete a logical drive, and then run BLKRRPART (e.g. via fdisk) on a logical drive which is "after" the deleted logical drive in the h->drv[] array, then
cciss_revalidatepanics because it will access the null pointer h->drv[x] when x hits the deleted drive.Thanks Stephen. I put this in for-linus for 2.6.37 and marked it for stable backport.
This got applied without the semicolon after 'continue' somehow and broke build. Please apply the patch below.
Michal
Quoted 1 line
From
70b720652024b23d71d72a1464f174df124600b7Mon Sep 17 00:00:00 2001
From: Michal Marek <[email protected]>
Date: Tue, 21 Dec 2010 00:35:56 +0100
Subject: [PATCH] cciss: Fix build
drivers/block/cciss.c:2839:3: error: expected ';' before 'if'
drivers/block/cciss.c +1 -1
@@ -2835,7 +2835,7 @@ static int cciss_revalidate(struct gendisk *disk)for (logvol =0 ; logvol <CISS_MAX_LUN ; logvol++) {if (!h->drv[logvol]) - continue +continue ;if (memcmp (h->drv[logvol]->LunID, drv->LunID,sizeof (drv->LunID)) ==0 ) {FOUND =1 ;
Jens Axboe
maintainerQuoted 9 lines · Michal Marek
Quoted 8 lines · Jens Axboe
Quoted 6 lines · Stephen M. Cameron
From: Stephen M. Cameron <StephenM.Cameron>
If you delete a logical drive, and then run BLKRRPART (e.g. via fdisk) on a logical drive which is "after" the deleted logical drive in the h->drv[] array, then
cciss_revalidatepanics because it will access the null pointer h->drv[x] when x hits the deleted drive.
Quoted 5 lines
Quoted 2 lines
Thanks Stephen. I put this in for-linus for 2.6.37 and marked it for stable backport.
This got applied without the semicolon after 'continue' somehow and broke build. Please apply the patch below.
I wonder how that happened. Thanks, I'll fix it up.
Signature · 1 line
Jens Axboe
Quoted 10 lines · Jens Axboe
Quoted 9 lines · Michal Marek
Quoted 8 lines · Jens Axboe
Quoted 6 lines · Stephen M. Cameron
From: Stephen M. Cameron <StephenM.Cameron>
If you delete a logical drive, and then run BLKRRPART (e.g. via fdisk) on a logical drive which is "after" the deleted logical drive in the h->drv[] array, then
cciss_revalidatepanics because it will access the null pointer h->drv[x] when x hits the deleted drive.
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Thanks Stephen. I put this in for-linus for 2.6.37 and marked it for stable backport.
This got applied without the semicolon after 'continue' somehow and broke build. Please apply the patch below.
I wonder how that happened. Thanks, I'll fix it up.
Linus already did I see.
Signature · 1 line
Jens Axboe