GEN003540 - The system must implement non-executable program stacks - 'kernel.exec-shield'

Information

A common type of exploit is the stack buffer overflow. An application receives, from an attacker, more data than it is prepared for and stores this information on its stack, writing beyond the space reserved for it. This can be designed to cause execution of the data written on the stack. One mechanism to mitigate this vulnerability is for the system to not allow the execution of instructions in sections of memory identified as part of the stack.

Solution

If the system being evaluated is running a Red Hat compatible operating system kernel, then ensure that the 'kernel.exec-shield' kernel parameter is set to '1'. If the system is running an Oracle Unbreakable Enterprise Kernel, this parameter does not exist. When an Unbreakable Enterprise Kernel is booted, Oracle's Data Execution Prevention (DEP) feature will leverage the hardware-enforced NX (never execute) bit of compatible CPUs to protect against code being executed from the stack. By default, DEP is enabled. If DEP is not enabled, ensure the string 'noexec=off' does not appear in /boot/grub/grub.conf.

First, determine if the system is operating an Oracle Unbreakable Enterprise Kernel (UEK):

# uname -r | grep uek

If no value is returned, the system is running a Red Hat compatible kernel. Edit (or add if necessary) the entry in /etc/sysctl.conf for the 'kernel.exec-shield' kernel parameter. Ensure this parameter is set to '1' as in:

kernel.exec-shield = 1

If this was not already the default, reboot the system for the change to take effect.

If the system was found to be running an Unbreakable Enterprise Kernel, then ensure the string 'noexec=off' is not found in /boot/grub/grub.conf:

# grep noexec=off /boot/grub/grub.conf

If found, remove the offending entry and reboot the system for the change to take effect.

See Also

https://dl.dod.cyber.mil/wp-content/uploads/stigs/zip/U_Oracle_Linux_5_V2R1_STIG.zip

Item Details

Category: CONFIGURATION MANAGEMENT

References: 800-53|CM-6b., CAT|II, CCI|CCI-000366, Rule-ID|SV-218477r603259_rule, STIG-ID|GEN003540, STIG-Legacy|SV-64439, STIG-Legacy|V-11999, Vuln-ID|V-218477

Plugin: Unix

Control ID: 516ede477b2103aeb6b8ddcf5926b4e367c3196dda5f512dd1f6d3911921c577