Skip to content

Commit

Permalink
Fix size bits in vka_untyped_retype for seL4_CapTableObject
Browse files Browse the repository at this point in the history
Signed-off-by: Arya Stevinson <[email protected]>
  • Loading branch information
astevins committed Jul 22, 2024
1 parent fcabdef commit b29e137
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions libsel4vka/include/vka/capops.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ static inline int vka_untyped_retype(vka_object_t *untyped, int type, int size_b
const cspacepath_t *dest)
{
size_bits = vka_get_object_size(type, size_bits);

if (type == seL4_CapTableObject) {
// The slot bits will be re-added during the syscall
size_bits -= seL4_SlotBits;
}

return seL4_Untyped_Retype(untyped->cptr, type, size_bits, dest->root, dest->dest, dest->destDepth, dest->offset,
num_objects);
}
Expand Down

0 comments on commit b29e137

Please sign in to comment.