提交 07543e0c 编写于 作者: S Stephen Cameron 提交者: James Bottomley

hpsa: guard against overflowing raid map array

In the code that translates logical drive LBAs to physical
drive LBAs if we overflow the raid map disk data array we
will get the wrong answers.  We do not expect that to happen,
but best to be on the safe side and guard against it anyway.
Reviewed-by: NScott Teel <scott.teel@pmcs.com>
Signed-off-by: NDon Brace <don.brace@pmcs.com>
Signed-off-by: NChristoph Hellwig <hch@lst.de>
上级 e4aa3e6a
......@@ -3921,6 +3921,9 @@ static int hpsa_scsi_ioaccel_raid_map(struct ctlr_info *h,
return IO_ACCEL_INELIGIBLE;
}
if (unlikely(map_index >= RAID_MAP_MAX_ENTRIES))
return IO_ACCEL_INELIGIBLE;
c->phys_disk = dev->phys_disk[map_index];
disk_handle = dd[map_index].ioaccel_handle;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册