Skip to content
  • Alexandros Frantzis's avatar
    vrend: Improve iov bound checking for transfers · 0bb764b6
    Alexandros Frantzis authored
    
    
    This commit improves bound checking by more accurately calculating
    the expected transfer size. This improvement is achieved in two ways:
    
    1. Using the image level (layer_)stride when the (layer_)stride is 0,
       which matches the interpretation we use for performing the actual
       read/write.
    
    2. Calculating the transfer size by using the exact end offset in
       the image, instead of using multiples of whole image rows.
    
    The increased accuracy increases safety, and also allows us to support
    some transfers with explicit strides that were previously rejected (see
    added test).
    
    Signed-off-by: default avatarAlexandros Frantzis <alexandros.frantzis@collabora.com>
    Reviewed-by: default avatarChia-I Wu <olvaffe@gmail.com>
    0bb764b6