Chapter 42. Enabling kstack randomization offset to improve security


The kernel stack (kstack) randomization offset security feature randomizes the kernel stack location for each system call. This prevents attackers to exploit kernel vulnerabilities.

Unlike other architectures that rely on cycle counters for kstack randomization, a method that can be unreliable, 64-bit ARM (aarch64) uses the kernel’s random number generator (RNG). This approach is preferred for several reasons:

  • The absence of a consistently enabled or fast cycle counter
  • The lack of a ubiquitous high-frequency timer
  • Systems that do not support the v8.5 FEAT_RNG instruction set

While the kernel RNG is generally a robust solution, it can introduce significant latency spikes, particularly for real-time (RT) workloads. As a result, the kstack randomization offset feature is disabled by default in the aarch64 real-time kernel. This decision, however, includes a tradeoff: it slightly reduces kernel security.

On 64-bit ARM (aarch64) systems, the kstack randomization offset feature is disabled by default in the real-time kernel. If the potential latency is acceptable for your use case, you can re-enable this feature to improve kernel security.

Prerequisites

  • You have administrator permissions.
  • Your system is running on 64-bit ARM (aarch64) architecture.

Procedure

  1. Enable the randomize_kstack_offset kernel parameter by using grubby.

    # grubby --update-kernel=ALL --args="randomize_kstack_offset=y"
  2. Reboot the system for changes to take effect.

    # reboot

Verification

  • Check that the randomize_kstack_offset=y parameter is specified in the /proc/cmdline file.

    # cat /proc/cmdline

    The output includes randomize_kstack_offset=y.

Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat Documentation

Legal Notice

Theme

© 2026 Red Hat
Back to top