xtensa: userspace: Warning about impl security

Add a Kconfig option (and build warning) alerting about the problem
of the kernel spilling register in behave of the userspace.

Signed-off-by: Flavio Ceolin <flavio.ceolin@intel.com>
This commit is contained in:
Flavio Ceolin 2023-10-17 15:50:31 -07:00 committed by Carles Cufí
parent dd36389879
commit b7d96ab42a
2 changed files with 11 additions and 0 deletions

View File

@ -3,3 +3,9 @@
zephyr_syscall_header(${ZEPHYR_BASE}/include/zephyr/arch/xtensa/arch.h)
set_property(GLOBAL PROPERTY PROPERTY_OUTPUT_FORMAT elf32-xtensa-le)
add_subdirectory(core)
if (CONFIG_XTENSA_INSECURE_USERSPACE)
message(WARNING "
This userspace implementation uses the window ABI this means that the kernel
will spill registers in behave of the userpsace. Use it carefully.")
endif()

View File

@ -180,6 +180,11 @@ config XTENSA_SYSCALL_USE_HELPER
This is a workaround for toolchains where they have
issue modeling register usage.
config XTENSA_INSECURE_USERSPACE
bool
default y if USERSPACE
depends on XTENSA_MMU
endif # CPU_HAS_MMU
endmenu