Skip to content

Commit

Permalink
vspace004: allocate a cap for the final pool
Browse files Browse the repository at this point in the history
This *coincidentally* fails with ret == seL4_RevokeFirst(9) if the
number of pools to allocate before failing is less than the actual
amount, because we don't allocate a capability for the last pool.

In essence, that could be happening even if we had the correct number
of pools, but doesn't because of how the kernel (presumably) checks
that the cap is free after checking the ASID pools are free.

Signed-off-by: julia <git.ts@trainwit.ch>
  • Loading branch information
midnightveil committed Feb 12, 2025
1 parent 3583555 commit 260d6f0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions apps/sel4test-tests/src/tests/vspace.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,15 @@ test_run_out_asid_pools(env_t env)
pool = vka_alloc_untyped_leaky(vka, seL4_PageBits);
test_assert(pool);
ret = vka_cspace_alloc_path(vka, &path);
test_eq(ret, seL4_NoError);
ret = seL4_ARCH_ASIDControl_MakePool(env->asid_ctrl, pool, env->cspace_root, path.capPtr, path.capDepth);
test_eq(ret, seL4_NoError);
}

pool = vka_alloc_untyped_leaky(vka, seL4_PageBits);
test_assert(pool);
ret = vka_cspace_alloc_path(vka, &path);
test_eq(ret, seL4_NoError);
/* We do one more pool allocation that is supposed to fail (at this point there shouldn't be any more available) */
ret = seL4_ARCH_ASIDControl_MakePool(env->asid_ctrl, pool, env->cspace_root, path.capPtr, path.capDepth);
test_eq(ret, seL4_DeleteFirst);
Expand Down

0 comments on commit 260d6f0

Please sign in to comment.