Skip to content

Commit

Permalink
libsel4vka: Fix vka_untyped_retype for CapTable
Browse files Browse the repository at this point in the history
Signed-off-by: Arya Stevinson <arya.stevinson@gmail.com>
  • Loading branch information
astevins committed Jul 22, 2024
1 parent fcabdef commit 4d6ea13
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 4d6ea13

Please sign in to comment.