[PATCH] Fix the LBA out of bounds check for VERIFY16

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tomo,

Please find a fix for VERIFY16 to avoid the LBA vs filesize check from
wrapping in 64 bit arithmetics.
For example we should compare LBA with filesize>>9,   not compare
lba<<9 with filesize since this can wrap.
We also have to be careful since lba+tl can wrap as well.

This is the same change as was earlier fixed for READ16/WRITE16 and friends.



With this patch the VERIFY16-LBA-OUT-OF-BOUNDS tests pass for tgtd :

$ ./bin/iscsi-test --dataloss --initiator-name=iqn.ronnie.test
--test="*verify16_beyondeol*" iscsi://127.0.0.1/iqn.ronnie.test/1
0273_verify16_beyond_eol:
========================
Verifying 2-256 blocks beyond end-of-device ... [OK]
Verify 1-256 blocks at LBA 2^63 ... [OK]
Verifying 1-256 blocks at LBA -1 ... [OK]
TEST T0273_verify16_beyondeol [OK]



regards
ronnie sahlberg

Attachment: 0001-SBC-Fix-the-LBA-out-of-range-check-in-VERIFY16.patch.gz
Description: GNU Zip compressed data

Attachment: 0001-SBC-Fix-the-LBA-out-of-range-check-in-VERIFY16.patch
Description: Binary data


[Index of Archives]     [Linux SCSI]     [Linux RAID]     [Linux Clusters]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]

  Powered by Linux