Poison kernel stack before returning from syscalls
An XCCDF Rule
Description
This option makes the kernel erase the kernel stack before returning from system calls. This has the effect of leaving the stack initialized to the poison value, which both reduces the lifetime of any sensitive stack contents and reduces potential for uninitialized stack variable exploits or information exposures (it does not cover functions reaching the same stack depth as prior functions during the same syscall). This configuration is available from kernel 4.20, but may be available if backported by distros. The configuration that was used to build kernel is available at/boot/config-*
.
To check the configuration value for CONFIG_GCC_PLUGIN_STACKLEAK
, run the following command:
grep CONFIG_GCC_PLUGIN_STACKLEAK /boot/config-*
For each kernel installed, a line with value "y" should be returned.
warning alert: Warning
There is no remediation for this besides re-compiling the kernel with the appropriate value for the config.
warning alert: Performance Warning
The performance impact on a single CPU system kernel is of 1% slowdown.
Rationale
This blocks most uninitialized stack variable attacks, with the performance impact being driven by the depth of the stack usage, rather than the function calling complexity.
- ID
- xccdf_org.ssgproject.content_rule_kernel_config_gcc_plugin_stackleak
- Severity
- Medium
- References
- Updated