The latest development version of this page may be more current than this released 1.14.1 version.
CONFIG_STACK_POINTER_RANDOM

Initial stack pointer randomization bounds

Type: int

Help

This option performs a limited form of Address Space Layout Randomization by offsetting some random value to a thread’s initial stack pointer upon creation. This hinders some types of security attacks by making the location of any given stack frame non-deterministic.

This feature can waste up to the specified size in bytes the stack region, which is carved out of the total size of the stack region. A reasonable minimum value would be around 100 bytes if this can be spared.

This is currently only implemented for systems whose stack pointers grow towards lower memory addresses.

Direct dependencies

!STACK_GROWS_UP

(Includes any dependencies from if’s and menus.)

Defaults

Kconfig definition

At kernel/Kconfig:657

Included via Kconfig:10Kconfig.zephyr:31

Menu path: (top menu) → General Kernel Options → Security Options

config STACK_POINTER_RANDOM
    int
    prompt "Initial stack pointer randomization bounds" if !STACK_GROWS_UP
    default 0 if !STACK_GROWS_UP
    depends on !STACK_GROWS_UP
    help
      This option performs a limited form of Address Space Layout
      Randomization by offsetting some random value to a thread's
      initial stack pointer upon creation. This hinders some types of
      security attacks by making the location of any given stack frame
      non-deterministic.

      This feature can waste up to the specified size in bytes the stack
      region, which is carved out of the total size of the stack region.
      A reasonable minimum value would be around 100 bytes if this can
      be spared.

      This is currently only implemented for systems whose stack pointers
      grow towards lower memory addresses.

(Definitions include propagated dependencies, including from if’s and menus.)