/Zephyr-latest/tests/kernel/mem_protect/stackprot/src/ |
D | mapped_stack.c | 22 * @brief To cause fault in guard pages. 24 * @param p1 0 if testing rear guard page, 1 if testing front guard page. 43 /* Middle of front guard page. */ in mapped_thread() 46 /* Middle of rear guard page. */ in mapped_thread() 55 TC_PRINT("Should have fault on guard page but not!\n"); in mapped_thread() 60 * @brief To create thread to fault on guard pages. 62 * @param is_front True if testing front guard page, false if testing rear guard page. 95 * @brief Test faulting on front guard page 109 * @brief Test faulting on rear guard page 123 * @brief Test faulting on front guard page in user mode [all …]
|
/Zephyr-latest/include/zephyr/arch/arm/ |
D | arch.h | 144 * @brief Declare a minimum MPU guard alignment and size 146 * This specifies the minimum MPU guard alignment/size for the MPU. This 147 * will be used to denote the guard section of the stack, if it exists. 149 * One key note is that this guard results in extra bytes being added to 151 * guard size into account. 155 * address (lowest address). Stack guard, if present, will comprise 158 * The guard region must include enough space for an exception frame 161 * the stack pointer refers, even if that is within the guard region, 166 * encounters either the stack guard region, or the stack allocation 185 * | MPU Guard, | [all …]
|
/Zephyr-latest/tests/arch/riscv/pmp/no-multithreading/ |
D | testcase.yaml | 10 arch.riscv.pmp.no-mt.isr-stack-guard: 12 arch.riscv.pmp.no-mt.main-stack-guard:
|
/Zephyr-latest/arch/arm/core/cortex_m/ |
D | thread.c | 70 /* Guard area is carved-out of the buffer instead of reserved in arch_new_thread() 79 /* Larger guard needed due to lazy stacking of FP regs may in arch_new_thread() 80 * overshoot the guard area without writing anything. We in arch_new_thread() 141 /* Switch to use a large MPU guard if not already. */ in z_arm_thread_stack_info_adjust() 144 /* Default guard size is used. Update required. */ in z_arm_thread_stack_info_adjust() 162 /* Switch to use the default MPU guard size if not already. */ in z_arm_thread_stack_info_adjust() 165 /* Large guard size is used. Update required. */ in z_arm_thread_stack_info_adjust() 186 * Adjust the MPU stack guard size together with the FPU 197 * MPU guard to safely detect privilege thread stack overflows. in z_arm_mpu_stack_guard_and_fpu_adjust() 202 * program a large MPU guard to detect privilege thread in z_arm_mpu_stack_guard_and_fpu_adjust() [all …]
|
/Zephyr-latest/arch/arm/core/mpu/ |
D | arm_core_mpu.c | 101 /* Main stack MPU guard to detect overflow. 104 * under CONFIG_MULTITHREADING=n, so the MPU guard (if 106 * and there is no requirement for larger guard area (FP 200 * thread, the stack guard will be defined in front of the in z_arm_configure_dynamic_mpu_regions() 201 * thread->stack_info.start. On a K_USER thread, the guard is defined in z_arm_configure_dynamic_mpu_regions() 266 /* Define a stack guard region for either the thread stack or the in z_arm_configure_dynamic_mpu_regions() 271 /* Privileged stack guard */ in z_arm_configure_dynamic_mpu_regions() 281 /* A K_USER thread has the stack guard protecting the privilege in z_arm_configure_dynamic_mpu_regions() 288 "Guard start: (0x%lx) below privilege stacks boundary: (%p)", in z_arm_configure_dynamic_mpu_regions() 294 * protect with a stack guard. in z_arm_configure_dynamic_mpu_regions() [all …]
|
D | arm_core_mpu_dev.h | 75 * memory region for a (supervisor) Thread Stack Guard. 83 * thread stack guard requires two additional MPU regions to be 84 * configured; one for defining the stack guard and an additional 88 * policy; the MPU stack guard applies more restrictive permissions on 95 * memory regions, a supervisor thread stack guard area may be configured 151 * programming MPU regions (such as a supervisor stack overflow guard) at
|
D | Kconfig | 32 guard, user thread stack, and application memory domains), if the 76 Floating Point (FP) context. The width of the guard is set to
|
/Zephyr-latest/arch/arm/core/cortex_a_r/ |
D | thread.c | 61 /* Guard area is carved-out of the buffer instead of reserved in arch_new_thread() 70 /* Larger guard needed due to lazy stacking of FP regs may in arch_new_thread() 71 * overshoot the guard area without writing anything. We in arch_new_thread() 149 /* Switch to use a large MPU guard if not already. */ in z_arm_thread_stack_info_adjust() 152 /* Default guard size is used. Update required. */ in z_arm_thread_stack_info_adjust() 170 /* Switch to use the default MPU guard size if not already. */ in z_arm_thread_stack_info_adjust() 173 /* Large guard size is used. Update required. */ in z_arm_thread_stack_info_adjust() 205 /* We're dropping to user mode which means the guard area is no in arch_user_mode_enter() 220 /* Stack guard area reserved at the bottom of the thread's in arch_user_mode_enter() 277 * attempt to access the stack guard area (if MPU Stack Guard feature [all …]
|
/Zephyr-latest/include/zephyr/arch/riscv/ |
D | arch.h | 44 * Therefore the guard area must be large enough to hold the esf, plus some 46 * as well as some guard size to cover possible sudden stack pointer 61 /* Kernel-only stacks have the following layout if a stack guard is enabled: 64 * | Guard | } Z_RISCV_STACK_GUARD_SIZE 84 * | Guard | } Z_RISCV_STACK_GUARD_SIZE 92 * mode so we need to make room for a possible stack guard area when enabled: 95 * | Guard | } Z_RISCV_STACK_GUARD_SIZE 104 * When transitioning to user space, the guard area will be removed from 125 /* The stack object will contain the PMP guard, the privilege stack, and then 129 * | Guard | } Z_RISCV_STACK_GUARD_SIZE
|
/Zephyr-latest/include/zephyr/arch/x86/ |
D | thread_stack.h | 49 * | Guard page (4096 bytes) | 58 * | Guard page (empty page) | 65 * | Guard page (empty page) | 69 * Without memory mapped stacks, the guard page is actually allocated 74 * thread stack are marked as user-accessible. The guard page is marked
|
/Zephyr-latest/include/zephyr/drivers/ |
D | counter.h | 101 * @name Counter guard period flags 108 * @brief Identifies guard period needed for detection of late setting of 142 * manages to activate the alarm. Therefore a guard period can be 582 * @brief Set guard period in counter ticks. 589 * time in case of a 32 bit timer. Setting a sufficiently large guard period will 592 * The guard period should be as many counter ticks as the driver will need at 595 * tick value but is still close enough to fall within the guard period, it will 601 * the guard period, then the driver will assume that this is intentional and 614 * - counting upwards, now = 4950, top value = 5000, guard period = 100: 616 * - counting downwards, now = 50, top value = 5000, guard period = 100: [all …]
|
/Zephyr-latest/cmake/compiler/gcc/ |
D | compiler_flags.cmake | 177 check_set_compiler_property(APPEND PROPERTY security_canaries -mstack-protector-guard=tls) 178 check_set_compiler_property(APPEND PROPERTY security_canaries_strong -mstack-protector-guard=tls) 179 check_set_compiler_property(APPEND PROPERTY security_canaries_all -mstack-protector-guard=tls) 180 …check_set_compiler_property(APPEND PROPERTY security_canaries_explicit -mstack-protector-guard=tls) 182 check_set_compiler_property(APPEND PROPERTY security_canaries -mstack-protector-guard=global) 183 …check_set_compiler_property(APPEND PROPERTY security_canaries_global -mstack-protector-guard=globa… 184 check_set_compiler_property(APPEND PROPERTY security_canaries_all -mstack-protector-guard=global) 185 …check_set_compiler_property(APPEND PROPERTY security_canaries_explicit -mstack-protector-guard=glo…
|
/Zephyr-latest/tests/arch/riscv/pmp/no-multithreading/src/ |
D | main.c | 65 * @brief Verify RISC-V specific PMP stack guard regions. 75 zassert_unreachable("Write to stack guard did not fault"); in ZTEST()
|
/Zephyr-latest/boards/snps/nsim/arc_classic/ |
D | nsim_nsim_sem_mpu_stack_guard.yaml | 2 name: SEM nSIM simulator (stack guard)
|
/Zephyr-latest/doc/hardware/porting/ |
D | arch.rst | 585 * For systems that implement stack protection using a guard memory region, 586 it's possible to overshoot the guard and corrupt adjacent data structures 594 CPU features for this purpose, or special read-only guard regions immediately 619 Guard-based stack overflow detection 624 on write. Reserved memory will be used for the guard region. 631 MMU-based systems should not reserve RAM for the guard region and instead 639 | Guard reserved memory | } K_KERNEL_STACK_RESERVED 641 | Guard carve-out | 646 Guard carve-outs for kernel stacks are uncommon and should be avoided if 650 the guard is unnecessary and shouldn't be unconditionally reserved. [all …]
|
/Zephyr-latest/dts/arm/microchip/mec5/ |
D | mec5_power_guards.dtsi | 7 /* Microchip MEC5 SoC's optional hardware power guard controllers
|
/Zephyr-latest/include/zephyr/kernel/internal/ |
D | mm.h | 257 * Map memory into virtual address space with guard pages. 260 * a succeeding guard pages. The memory mapped via this function must be 264 * virtual address space with a preceding and a succeeding guard pages. 285 * Note that the allocation includes two guard pages immediately before 287 * the requested size plus the size of these two guard pages. 310 * and the two guard pages surrounding the region.
|
/Zephyr-latest/arch/arm/core/ |
D | userspace.S | 123 * z_arm_configure_dynamic_mpu_regions() may re-program the MPU Stack Guard 124 * to guard the privilege stack for overflows (if building with option 159 /* from right past the guard right up to the end */ 200 * Guard the default (user) stack until thread drops privileges. 208 * would re-configure PSPLIM to guard the privileged stack; we enforce 225 /* Set PSPLIM to guard the thread's user stack. */ 323 * Rationale: since we execute in PRIV mode and no MPU guard 328 * At this point PSPLIM is already configured to guard the default (user) 484 * Guard the default (user) stack until thread drops privileges. 492 * would re-configure PSPLIM to guard the privileged stack; we enforce [all …]
|
D | Kconfig | 208 - the MPU-based stack guard 211 The two stack guard options are mutually exclusive. The 213 prioritized over the MPU-based stack guard. The developer 215 stack guard, if this is desired.
|
/Zephyr-latest/include/zephyr/arch/arc/ |
D | arch.h | 132 /* Kernel-only stacks have the following layout if a stack guard is enabled: 135 * | Guard | } Z_ARC_STACK_GUARD_SIZE 159 * the stack object will contain the MPU guard, the privilege stack, and then 163 * | Guard | } Z_ARC_STACK_GUARD_SIZE 234 * guard. This is just a minimally-sized region at the beginning of the stack 238 * | Guard | } Z_ARC_STACK_GUARD_SIZE 251 /* No stack guard, no userspace, Use defaults for everything. */
|
/Zephyr-latest/drivers/counter/ |
D | counter_rpi_pico_timer.c | 146 static int counter_rpi_pico_timer_set_guard_period(const struct device *dev, uint32_t guard, in counter_rpi_pico_timer_set_guard_period() argument 151 __ASSERT_NO_MSG(guard < counter_rpi_pico_timer_get_top_value(dev)); in counter_rpi_pico_timer_set_guard_period() 153 data->guard_period = guard; in counter_rpi_pico_timer_set_guard_period()
|
/Zephyr-latest/arch/arc/core/mpu/ |
D | Kconfig | 25 If your core supports that, it is preferred over MPU stack guard.
|
/Zephyr-latest/doc/kernel/usermode/ |
D | mpu_userspace.rst | 19 guard (if applicable).
|
/Zephyr-latest/samples/bluetooth/bap_unicast_client/src/ |
D | stream_lc3.h | 16 /* Since the lc3.h header file is not available when CONFIG_LIBLC3=n, we need to guard the include
|
/Zephyr-latest/include/zephyr/kernel/ |
D | mm.h | 177 * Note that the allocation includes two guard pages immediately before 179 * the requested size plus the size of these two guard pages. 225 * Note that the allocation includes two guard pages immediately before 227 * the requested size plus the size of these two guard pages.
|