zephyr/arch
Leandro Pereira b007b64d30 kernel: Add option to ensure writable pages are not executable
This adds CONFIG_EXECUTE_XOR_WRITE, which is enabled by default on
systems that support controlling whether a page can contain executable
code.  This is also known as W^X[1].

Trying to add a memory domain with a page that is both executable and
writable, either for supervisor mode threads, or for user mode threads,
will result in a kernel panic.

There are few cases where a writable page should also be executable
(JIT compilers, which are most likely out of scope for Zephyr), so an
option is provided to disable the check.

Since the memory domain APIs are executed in supervisor mode, a
determined person could bypass these checks with ease.  This is seen
more as a way to avoid people shooting themselves in the foot.

[1] https://en.wikipedia.org/wiki/W%5EX

Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>
2017-11-02 13:40:50 -07:00
..
arc subsys: Add random subsystem 2017-11-01 08:26:29 -04:00
arm kernel: Add option to ensure writable pages are not executable 2017-11-02 13:40:50 -07:00
common tests: benchmarking: cleanup of the benchmarking code. 2017-11-02 09:01:06 -04:00
nios2 doc: Fix misspellings in header/doxygen comments 2017-10-17 19:40:29 -04:00
riscv32 doc: Fix misspellings in header/doxygen comments 2017-10-17 19:40:29 -04:00
x86 subsys: Add random subsystem 2017-11-01 08:26:29 -04:00
xtensa cleanup: rename fiber/task -> thread 2017-10-30 18:41:15 -04:00
Kconfig kernel: Add option to ensure writable pages are not executable 2017-11-02 13:40:50 -07:00
Makefile gen_isr_tables: New static interrupt build mechanism 2017-02-11 01:27:58 +00:00