zephyr/tests/kernel
Stephen Smalley e3fe3ebb3f tests/kernel/mem_protect/userspace: test access to other thread stack
Add tests of the ability to read or write the stack of another thread.
Use semaphores for explicit synchronization of the start and end of the
other thread to ensure that the attempted stack access occurs while the
thread is alive.  This ensures that the MMU/MPU has been configured at
least once to allow userspace access to the stack, and that any
removal of access upon thread termination has not yet occurred.  This
therefore should exercise changing the MMU/MPU configuration to remove
access to the other thread's stack when switching back to our
thread.

Tested on qemu_x86 (pass) and on frdm_k64f (with and without the ARM
userspace patches; with them, the tests pass; without, they fail as
expected).  Also, as with most of the other tests, if you replace
ztest_user_unit_test() with ztest_unit_test(), then the tests fail as
expected.

Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2017-12-14 09:08:19 -08:00
..
alert/alert_api tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
arm_irq_vector_table tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
arm_runtime_nmi tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
bitfield tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
boot_page_table tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
common tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
context tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
critical tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
errno tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
fatal tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
fifo/fifo_api tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
fp_sharing tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
gen_isr_table tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
irq_offload tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
libs tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
lifo/lifo_api tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
mbox/mbox_api tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
mem_heap/mheap_api_concept tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
mem_pool tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
mem_protect tests/kernel/mem_protect/userspace: test access to other thread stack 2017-12-14 09:08:19 -08:00
mem_slab tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
msgq/msgq_api tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
multilib tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
mutex tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
obj_tracing tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
pending tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
pipe/pipe_api tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
poll tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
profiling/profiling_api tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
pthread tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
queue tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
semaphore/sema_api tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
sleep tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
sprintf tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
stack/stack_api tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
static_idt tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
systhreads tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
test_build tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
threads tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
tickless tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
timer tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
userbufer_validate tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
workq tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00
xip tests/samples: fixed yaml syntax 2017-12-11 14:47:08 -05:00