1.. _protection_tests: 2 3Protection tests 4################################# 5 6Overview 7******** 8This test case verifies that protection is provided 9against the following security issues: 10 11* Write to read-only data. 12* Write to text. 13* Execute from data. 14* Execute from stack. 15* Execute from heap. 16 17Building and Running 18******************** 19 20This project can be built and executed as follows: 21 22 23.. zephyr-app-commands:: 24 :zephyr-app: tests/kernel/mem_protect/protection 25 :board: <board name> 26 :goals: run 27 :compact: 28 29Connect the board to your host computer using the USB port. 30Flash the generated zephyr.bin on the board. 31Reset the board. 32 33Sample Output 34============= 35 36.. code-block:: console 37 38 ***** BOOTING ZEPHYR OS v1.8.99 - BUILD: Jun 19 2017 12:44:27 ***** 39 Running test suite test_protection 40 tc_start() - write_ro 41 trying to write to rodata at 0x00003124 42 ***** BUS FAULT ***** 43 Executing thread ID (thread): 0x200001bc 44 Faulting instruction address: 0x88c 45 Imprecise data bus error 46 Caught system error -- reason 0 47 =================================================================== 48 PASS - write_ro. 49 tc_start() - write_text 50 trying to write to text at 0x000006c0 51 ***** BUS FAULT ***** 52 Executing thread ID (thread): 0x200001bc 53 Faulting instruction address: 0xd60 54 Imprecise data bus error 55 Caught system error -- reason 0 56 =================================================================== 57 PASS - write_text. 58 tc_start() - exec_data 59 trying to call code written to 0x2000041d 60 ***** BUS FAULT ***** 61 Executing thread ID (thread): 0x200001bc 62 Faulting instruction address: 0x2000041c 63 Imprecise data bus error 64 Caught system error -- reason 0 65 =================================================================== 66 PASS - exec_data. 67 tc_start() - exec_stack 68 trying to call code written to 0x20000929 69 ***** BUS FAULT ***** 70 Executing thread ID (thread): 0x200001bc 71 Faulting instruction address: 0x20000928 72 Imprecise data bus error 73 Caught system error -- reason 0 74 =================================================================== 75 PASS - exec_stack. 76 tc_start() - exec_heap 77 trying to call code written to 0x20000455 78 ***** BUS FAULT ***** 79 Executing thread ID (thread): 0x200001bc 80 Faulting instruction address: 0x20000454 81 Imprecise data bus error 82 Caught system error -- reason 0 83 =================================================================== 84 PASS - exec_heap. 85 =================================================================== 86 PROJECT EXECUTION SUCCESSFUL 87