CA-139732: check the block range of a VHD before access

In a VHD chain, it's possible that the parent VHD might have a size different from its children. So when backtracing the location of a block in a VHD chain, we should always check whether the block is out of the index range of the current node under examination, otherwise an "index out of bound" error might raise.

We should give up immediately if the block is outside of current node, even if (in the rare cases) its parent (or early ancestors) might have a larger size that could potentially cover that block. As in this case, it means the current node has shrunk to give up the extra blocks. Data previously in those block should be no longer accessible from that point onwards. Giving access to the data preceding this is a security problem.

Signed-off-by: Zheng Li <dev@zheng.li>
Merge pull request #2 from zli/trunk-ring3

CA-139732