]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] zfcp: Bounds checking for deferred error trace
authorSteffen Maier <maier@linux.vnet.ibm.com>
Tue, 4 Sep 2012 13:23:31 +0000 (15:23 +0200)
committerJames Bottomley <JBottomley@Parallels.com>
Mon, 24 Sep 2012 08:11:01 +0000 (12:11 +0400)
commitef735afbb247b63e696fd1b9dc0bdf035315c7e6
tree5683b67c13a599c43d75f038a341f9dd79c49147
parent2dcd4cd73cfde06115ad370aad89220bbf5bfda7
[SCSI] zfcp: Bounds checking for deferred error trace

The pl vector has scount elements, i.e. pl[scount-1] is the last valid
element. For maximum sized requests, payload->counter == scount after
the last loop iteration. Therefore, do bounds checking first (with
boolean shortcut) to not access the invalid element pl[scount].

Do not trust the maximum sbale->scount value from the HBA
but ensure we won't access the pl vector out of our allocated bounds.
While at it, clean up scoping and prevent unnecessary memset.

Minor fix for 2c36c78e0bafdc2e59034ae7f0ab3ffd6c0e88bd
"[SCSI] zfcp: support for hardware data router"

Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Reviewed-by: Martin Peschke <mpeschke@linux.vnet.ibm.com>
Cc: <stable@vger.kernel.org> #3.2+
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/s390/scsi/zfcp_dbf.c
drivers/s390/scsi/zfcp_qdio.c