Memory Protection
Show that mapping an irregular size buffer works and RW flag is respected.
Show that mapping with/without K_MEM_PERM_EXEC works as expected.
Show that memory mapping doesn’t have unintended side effects.
Test that k_mem_unmap_phys_bare() unmaps the memory and it is no longer accessible afterwards.
Show that k_mem_unmap_phys_bare() can reclaim the virtual region correctly.
Test object permission inheritance except of the parent thread object.
Test child thread inherits parent’s thread resource pool.
Test access to a invalid semaphore who’s address is NULL.
Test grant access of given NULL kobject.
Test grant access of given NULL thread in usermode.
Test grant access of given NULL kobject in usermode.
Test grant access to all the kobject for thread.
Test syscall can take a different type of kobject.
Test user thread can access a k_object() without grant.
Test access revoke.
Test access revoke.
Test access grant between threads.
Test revoke permission of a k_object() from userspace.
Test release and access grant an invalid kobject.
Test supervisor thread grants kernel objects all access public status.
Test access permission of a terminated thread.
Test grant access to a valid kobject but invalid thread id.
Object validation checks.
Object validation checks without init access.
Test syscall on a kobject which is not initialized and has access.
Test to reinitialize the k_thread() object.
Test thread create from a user thread and check permissions.
Test create new user thread from a user thread with in-use stack obj.
Test creates new thread from usermode without stack access.
Test to validate user thread spawning with stack overflow.
Test to check stack overflow from user thread.
Test to create a new supervisor thread from user.
Create a new essential thread from user.
Thread creation with priority is higher than current thread.
Create a new thread whose priority is invalid.
Test when thread exits, kernel marks stack objects uninitialized.
Test free an invalid kernel object.
Test alloc an invalid kernel object.
Test kernel object until out of memory.
Test kernel object allocation.
Test grant access failed in user mode.
Test get all kernel object list.
Check if the mem_domain is configured and accessible for userspace.
Show that a user thread can’t touch partitions not in its domain.
Show that a read-only partition can’t be written to.
Show that adding/removing partitions works.
Test access memory domain APIs allowed to supervisor threads only.
Show that boot threads belong to the default memory domain.
Test system assert when new partition overlaps the existing partition.
Test system assert when adding memory partitions more than possible.
Test error case of initializing memory domain fail.
Test error case of adding null memory partition fail.
Test error case of adding zero sized memory partition fail.
Test error case of memory partition address wraparound.
Test error case of removing memory partition fail.
Test to verify object permission.
Test requestor thread will implicitly be assigned permission on the dynamically allocated object.
Test dynamically allocated kernel object release memory.
Test write to read only section.
Test to execute on text section.
Test execution from data section.
Test execution from stack section.
Test execution from heap.
test Stack Protector feature using canary
Test optional mechanism to detect stack overflow.
Test stack canaries behavior.
Test faulting on front guard page.
Test faulting on rear guard page.
Test faulting on front guard page in user mode.
Test faulting on rear guard page in user mode.
Test to demonstrate usage of k_usermode_string_nlen()
Test to verify syscall for string alloc copy.
Test sys_call for string copy.
Test to demonstrate system call for copy.
Test to check if the thread is in user mode.
Test to write to a control register.
Test to disable memory protection.
Test to read from kernel RAM.
Test to write to kernel RAM.
Test to write kernel RO.
Test to write to kernel text section.
Test to read from kernel data section.
Test to write to kernel data section.
Test to write to privilege stack.
Test to pass object to a system call without permissions.
Test to start kernel thread from usermode.
Test to read from another thread’s stack.
Test to write to other thread’s stack.
Test to revoke access to kobject without permission.
Test to access object after revoking access.
Test to check supervisor thread enter one-way to usermode.
Test to write to kobject using pipe.
Test to read from kobject using pipe.
Test creation of new memory domains.
Show that changing between memory domains and dropping to user mode works as expected.
Show that self-removing a partition from a domain we are a member of, and then dropping to user mode faults as expected.
Show that changing between memory domains and then switching to another thread in the same domain works as expected.
Show that self-removing a partition from a domain we are a member of, and then switching to another user thread in the same domain faults as expected.
Test unimplemented system call.
Test bad syscall handler.
Test recycle object.
Test access kernel object with private data using system call.
Test kernel provides user thread read/write access to its own stack memory buffer.
Show that the idle thread stack size is correct.
Test sys_call does not write to user stack.
Test CPU scrubs registers after system call.
Test that MMU flags on RAM virtual address range are set properly.
Test that the NULL virtual page is always non-present.
Dump kernel’s page tables to console.