Skip to content
Commit 3ad02073 authored by Joshua Domagalski's avatar Joshua Domagalski Committed by Andrew Boie
Browse files

tests: userspace: test revoke, user_mode_enter



Added three tests for kernel objects focusing on 1) revoking
access to a k_object that the thread does not have
permissions to access, 2) accessing a k_object after
permissions to access it were revoked, and 3) trying to
revoke access to a k_object from a parent thread by a
child thread.  Additionally, added a test for
k_thread_user_mode_enter().

revoke_noperms_object() tests by calling
k_object_access_revoke() on a semaphore (kernel object) that it
does not have access to (ksem).

access_after_revoke() tests ability to access a semaphore after
access has been revoked by itself.

revoke_other_thread() tests whether a thread can revoke access
for an object for which it has permissions from a thread for
which it does not have permissions.

user_mode_enter() tests whether k_thread_user_mode_enter()
truly enters user mode.

Tested on qemu_x86 and frdm_k64 with pr-4974 applied, passes
on qemu_x86 but requires small fix for ARM (will submit
separately).

Signed-off-by: default avatarJoshua Domagalski <jedomag@tycho.nsa.gov>
parent 461511e1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment