vkr: enforce ring control vars are 32-bit aligned

Signed-off-by: Ryan Neph <ryanneph@google.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
macos/master
Ryan Neph 3 years ago
parent 8417c2413d
commit 0097858dc7
  1. 7
      src/venus/vkr_transport.c

@ -177,6 +177,13 @@ validate_ring_layout(const struct vkr_ring_layout *layout, size_t buf_size)
regions[i]->offset, regions[i]->size); regions[i]->offset, regions[i]->size);
return false; return false;
} }
if (regions[i]->offset & 0x3) {
vkr_log("ring buffer control variable (offset=%lu, size=%lu) must be"
" 32-bit aligned in shared memory layout",
regions[i]->offset, regions[i]->size);
return false;
}
} }
/* assumes region->size == 0 is valid */ /* assumes region->size == 0 is valid */

Loading…
Cancel
Save