Linux Kernel Hardening Guide
Linux Kernel Hardening Guide
This article discusses the process by which your kernel's configuration can be strengthened to protect against common security exploits.
This is sometimes referred to as hardening, or specifically in this context, kernel configuration hardening.
Preface
A Linux kernel configuration is a file which defines all of the enabled (or disabled) options which are compiled in to your kernel. If you
have not seen one before, they generally reside in the kernel's build directory with a filename of ".config". They are sometimes collapsed
in to a defconfig (default config) file which only shows options which were not already selected by default.
This discussion will present many configuration tables in the form of:
Architecture to which this option applys (X86 and/or Kernel versions in which OPTION2 A description of
OPTION2=is not set
ARM) exists OPTION2
In this case, it is recommended that the fictional option, OPTION1, is selected (CONFIG_OPTION1=y) in your kernel's .config or
defconfig file. It is also recommended that OPTION2 is disabled (CONFIG_OPTION2=is not set) in your kernel's .config or defconfig
file.
The option descriptions are sometimes difficult to interpret and may require further research. If you find an option that you'd like to know
more information about, you may have to inspect the kernel source, search LWN, search Patchwork, or use your web search engine of
choice.
Adding an additional level of protection against a known exploit by enabling a configuration item. For example:
Mitigating Spectre attacks with CONFIG_RETPOLINE=y (which traps the processor's speculative execution paths for
indirect address calls by using a return trampoline).
Disabling a configuration item or subsystem which is known to be exploitable. For example:
Disabling the USB networking subsystem (USB_USBNET=is not set), so that applications using network-based IPC(Inter-
Processor Communication) mechanisms may not be inadvertently exposed through a USB port.
Disabling /dev/mem access to physical memory (DEVMEM=is not set), so that physical memory cannot be easily modified.
Enabling general security strengthening features in the kernel (which may necessarily protect against a presently known attack).
For example:
Reducing the risk of memory page leakage by enabling page poisoning (PAGE_POISONING=Y) to overwrite any
potentially sensitive information upon freeing.
Enabling Security-Enhanced Linux
Disabling any unused kernel configuration options. If you don't need it, disable it. As an added bonus, doing so may also improve
your boot times.
ARM, ARM64,
DEVMEM=is not set X86_32, 4.0-4.20, 5.0-5.17 Do not allow access to physical memory via /dev/mem
X86_64
Fill the pages with poison patterns after free_pages() and verify the patterns
ARM, ARM64,
before alloc_pages. The filling of the memory helps reduce the risk of
PAGE_POISONING=Y X86_32, 4.6-4.20, 5.0-5.17
information leaks from freed data. This must be enabled from the boot
X86_64
cmdline with page_poison=1
The latter two options can help to protect against exploits which have not yet been discovered or released into the public domain (e.g.
zero-day exploits) by reducing your kernel's exploitable attack surface.
Analyzing, understanding, and modifying the kernel configuration with these tasks in mind is not trivial. Furthermore, in a large project it
may not be clear exactly who is using which kernel configuration option. This can result in iterative backstepping until you arrive at a
final configuration which works for your entire team.
There's also a maintenance burden once you have created your final configuration. When you upgrade your kernel, many of the
configuration options will have been removed and renamed. This will require another assessment and configuration period. Keeping your
kernel up to date is extremely important, as security features are continuously added and revised in newer kernels. Starting a project with
a long term stable (LTS) kernel is recommended, as an LTS kernel provides smaller (and sometimes backported) version increments to
resolve security flaws (e.g upgrading from 5.0.x to 5.0.y). Such patches are provided until the long term stable support period ends.
Cost-Benefit Analysis
Not all configuration items provide the same cost-benefit as others. To some extent, most options will have an impact in these key areas:
Compile Time
This is especially true for security features which are checked by the compiler during compile time. For example,
GCC_PLUGIN_STACKLEAK=Y will block uninitialized stack variable attacks through the use of a compiler plugin which
searches for and initializes such variables.
This should not be considered a concern. Added compilation time is well worth the added security.
Kernel Binary Size
This is usually not a concern. Adding and removing features may change the kernel size by a few megabytes, which is
generally negligible on modern systems.
Boot time
For example, DM_CRYPT=y, which adds drive encryption capabilities to your kernel, will add additional non-neglibile boot
time to your system. This is because it may require booting in to an Initial Ram Filesystem, retreiving your disk encryption
key, and ultimately mounting the encrypted disk through the device mapper subsystem. All of these steps add time to the
boot process.
Processor Load
This is perhaps the most concerning option and must be determined by trial and error. If every available security option is
enabled on a slower ARM processor, there may be too much overhead to reliably run your processes (at a reasonable
latency).
For example, erasing memory with PAGE_POISONING=Y will use CPU cycles. The amount of overhead added will be
dependent upon factors such as your CPU and RAM speed.
Fill the pages with poison patterns after free_pages() and verify the
ARM, ARM64,
patterns before alloc_pages. The filling of the memory helps reduce
PAGE_POISONING=Y X86_32, 4.6-4.20, 5.0-5.17
the risk of information leaks from freed data. This must be enabled
X86_64
from the boot cmdline with page_poison=1
Some configuration items will provide a better cost-benefit. Configuration items which have minimal impact on processor load are most
valuable. For example, these add virtually no CPU overhead:
Disabling DEBUG_BUGVERBOSE, which will help ensure that sensitive backtrace information is not leaked upon a kernel
BUG() condition.
Enabling ARCH_HAS_ELF_RANDOMIZE, which will make repeat exploits much more difficult by randomizing certain
memory locations.
Enabling DEBUG_VIRTUAL will enable some sanity checking in virt_to_page translation at the cost of CPU cycles.
Enabling INIT_ON_ALLOC_DEFAULT_ON or INIT_ON_FREE_DEFAULT_ON will protect against heap memory leaks by
erasing the regions after use, at the cost of erase time.
ARM, ARM64,
ARCH_HAS_ELF_RANDOMIZE=Y X86_32, 4.1-4.20, 5.0-5.17 Randomized locations for stack, mmap, brk, and ET_DYN
X86_64
ARM, ARM64, All page allocator and slab allocator memory will be zeroed when
INIT_ON_ALLOC_DEFAULT_ON=Y X86_32, 5.3-5.17 freed, eliminating many kinds of "uninitialized heap memory" flaws,
X86_64 especially heap content exposures.
Using multiple kernel configurations (development and production) can be an option. While it is wise to develop on a prototype system
that most closely resembles a production system (as to not cause unforseen bugs in changing timing conditions and loads between
configurations), some security options be too cumbersome to reasonably develop on. If you're writing a kernel driver and you need to use
a tracing tool or read a core dump, then certainly enable them while developing.
In the Timesys Kernel Hardening Analysis Tool, the kernel security options have been divided into various groups. This categorization is
by no means a definitive separation; some options could be further categorized or applied to multiple categories.
Memory Protection
Memory exploits are classes of attack in which an entity is able to retrieve or modified privileged information about the system. These
can be further categorized into:
Stack Overflow Protections: These are security features which seek to prevent access to and tampering of stack variables in
memory. A stack canary (an arbitrary value sitting at the top of the stack, which, if modified, alerts the kernel of tampering) is
sometimes mentioned in these protections.
ARM, ARM64,
4.18-4.20, 5.0- Adds the CONFIG_STACKPROTECTOR canary logic to
STACKPROTECTOR_STRONG=Y X86_32,
5.17 additional conditions related to variable assignment.
X86_64
STACKPROTECTOR_PER_TASK=Y ARM, ARM64 5.0-5.17 Use a different stack canary value for each task
ARM, ARM64,
3.18-3.19, 4.0- Additional validation check on commonly targeted structure.
SCHED_STACK_END_CHECK=Y X86_32,
4.20, 5.0-5.17 Detect stack corruption on calls to schedule()
X86_64
ARM64,
If this is set, STACKLEAK metrics for every task are
STACKLEAK_METRICS=is not set X86_32, 5.2-5.17
available in the /proc file system.
X86_64
ARM64,
STACKLEAK_RUNTIME_DISABLE=is
X86_32, 5.2-5.17 If set, allows runtime disabling of kernel stack erasing
not set
X86_64
ARM, ARM64, Randomizes the freelist order used on creating new pages. This
SLAB_FREELIST_RANDOM=Y X86_32, 4.7-4.20, 5.0-5.17 security feature reduces the predictability of the kernel slab allocator
X86_64 against heap overflows.
User Copy Protection: These are security features which seek to prevent memory exploitation during kernel and userspace memory
transfer transactions.
Kernel Address Space Layout Randomization (KASLR): A security method by which kernel memory structures are randomized in
order to prevent repeat or replay-style attacks.
ARM, ARM64, Randomizes the freelist order used on creating new pages. This
SLAB_FREELIST_RANDOM=Y X86_32, 4.7-4.20, 5.0-5.17 security feature reduces the predictability of the kernel slab allocator
X86_64 against heap overflows.
ARM, ARM64,
4.13-4.20, 5.0-
GCC_PLUGIN_RANDSTRUCT=Y X86_32, Randomizes layout of sensitive kernel structures
5.17
X86_64
These are configuration options which can be selected to reduce the potential for exposure to unknown zero-day attacks by limiting the
attack surface as much as we can. These are options that reduce the amount of information exposure and compiled-firmware attack
surface (Again: If you don't need it, disable it).
Kernel Replacement Attacks: Methods in which a kernel binary could be replaced during runtime.
Module Security Attacks: These are attacks which can be performed by loading a tainted, custom, module in to a system or
maliciously modifying a pre-existing module's memory. The mitigations for this mostly consist of restricting execution regions,
making such regions read-only, and signature checking prior to loading modules.
ARM, ARM64, Module text and rodata memory will be made read-only, and non-
4.11-4.20, 5.0-
STRICT_MODULE_RWX=Y X86_32, text memory will be made non-executable. This provides protection
5.17
X86_64 against certain security exploits (e.g. writing to text)
ARM, ARM64,
3.7-3.19, 4.0-4.20,
MODULE_SIG=Y X86_32, Enable module signature verification
5.0-5.17
X86_64
ARM, ARM64,
3.9-3.19, 4.0-4.20, Automatically sign all modules during modules_install (so we don't
MODULE_SIG_ALL=Y X86_32,
5.0-5.17 have to do this manually)
X86_64
ARM, ARM64,
3.7-3.19, 4.0-4.20,
MODULE_SIG_SHA512=Y X86_32, Sign modules with SHA-512 algorithm
5.0-5.17
X86_64
ARM, ARM64,
3.7-3.19, 4.0-4.20,
MODULE_SIG_FORCE=Y X86_32, Require modules to be validly signed
5.0-5.17
X86_64
ARM, ARM64,
Varies depending Helps catch unintended modifications to loadable kernel module's
DEBUG_SET_MODULE_RONX=Y X86_32,
on architecture text and read-only data. It also prevents execution of module data.
X86_64
ARM, ARM64,
If enabled, this allows the libc5 and earlier dynamic linker usblib
USELIB=is not set X86_32, 4.5-4.20, 5.0-5.17
syscall. Should no longer be needed.
X86_64
There will be no vsyscall mapping at all. This will eliminate any risk
X86_32, of ASLR bypass due to the vsyscall fixed address mapping.
LEGACY_VSYSCALL_NONE=Y 4.4-4.20, 5.0-5.17
X86_64 Attempts to use the vsyscalls will be reported to dmesg, so that
either old or malicious userspace programs can be identified.
ARM, ARM64,
SECURITY_LOCKDOWN_LSM_EARLY=Y X86_32, 5.4-5.17 Enable lockdown LSM early in init
X86_64
Many security features are architecture specific because of a specific hardware level reason (differing instruction set, caches, branch
predictors, and more) or merely because they have not been implemented on a specific architecture. Looking at
DEBUG_SET_MODULE_RONX, we find that it was a relatively recent addition for ARM and ARM64 architectures.
3.18-3.19, 4.0-
DEBUG_SET_MODULE_RONX=Y ARM64 ↑
4.10
3.14-3.19, 4.0-
DEBUG_SET_MODULE_RONX=Y ARM ↑
4.10
Looking at the Spectre and Meltdown variants, there are differing options depending on architecture as well:
This tool is available as part of the meta-vigishield layer, learn more about VigiShield here
This Yocto-based tool can perform some security-minded analysis of your kernel configuration. The tool generates a report that shows
the status of many configuration items which we have assessed as being security related.
The output from the Timesys Kernel Hardening Analysis Tool is formatted as a Comma Separated List (CSV). As an example, here are
the first few lines from a sample report are:
(MODULE_SIG_FORCE=Y) OR
FAILED
(MODULES=is not set)
In this case, GCC_PLUGIN_RANDSTRUCT was not enabled in the kernel configuration file, so the return status is, "FAILED."
The rest of the options were set appropriately and passed (STACKPROTECTOR and STACKPROTECTOR_STRONG).
Modules are also enabled without any forced signature checking, so the OR conditional [(MODULE_SIG_FORCE=Y) OR
(MODULES=is not set)] for that has also failed.
This is the entire list of conditions which the Timesys Kernel Hardening Analysis Tool presently considers:
Fill the pages with poison patterns after free_pages() and verify
ARM, ARM64,
the patterns before alloc_pages. The filling of the memory helps
PAGE_POISONING=Y X86_32, 4.6-4.20, 5.0-5.17
reduce the risk of information leaks from freed data. This must be
X86_64
enabled from the boot cmdline with page_poison=1
ARM, ARM64, Skip the sanity checking on alloc, only fill the pages with poison
PAGE_POISONING_NO_SANITY=is
X86_32, 4.6-4.20, 5.0-5.10 on free. This reduces some of the overhead of the poisoning
not set
X86_64 feature.
Instead of using the existing poison value, fill the pages with
ARM, ARM64, zeros. This makes it harder to detect when errors are occurring
4.19-4.20, 5.0-
PAGE_POISONING_ZERO=Y X86_32, due to sanitization but the zeroing at free means that it is no
5.10
X86_64 longer necessary to write zeros when GFP_ZERO is used on
allocation.
If this is set, kernel text and rodata memory will be made read-
ARM, ARM64,
4.11-4.20, 5.0- only, and non-text memory will be made non-executable. This
STRICT_KERNEL_RWX=Y X86_32,
5.17 provides protection against certain security exploits (e.g.
X86_64
executing the heap or modifying text)
ARM, ARM64,
2.6.16-2.6.39, 3.0-
DEBUG_RODATA=Y X86_32, Same as CONFIG_STRICT_KERNEL_RWX prior to 4.11
3.19, 4.0-4.10
X86_64
ARM, ARM64, All page allocator and slab allocator memory will be zeroed when
INIT_ON_ALLOC_DEFAULT_ON=Y X86_32, 5.3-5.17 freed, eliminating many kinds of "uninitialized heap memory" flaws,
X86_64 especially heap content exposures.
ARM, ARM64,
Perform full reference count validation, protecting against various
REFCOUNT_FULL=Y X86_32, 4.13-4.20, 5.0-5.4
user-after-free security flaw conditions, at the expense of speed
X86_64
ARM, ARM64,
3.1-3.19, 4.0-4.20,
IOMMU_SUPPORT=Y X86_32, For mitigating DMA attacks
5.0-5.17
X86_64
ARM, ARM64,
ARCH_HAS_ELF_RANDOMIZE=Y X86_32, 4.1-4.20, 5.0-5.17 Randomized locations for stack, mmap, brk, and ET_DYN
X86_64
ARM, ARM64,
DEBUG_ALIGN_RODATA=Y X86_32, 4.6-4.20, 5.0-5.17 If this is set, rodata will be made explicitly non-executable.
X86_64
This value can be used to select the number of bits to use to determine
X86_64,
ARCH_MMAP_RND_BITS=32 4.5-4.20, 5.0-5.17 the random offset to the base address of vma regions resulting from
ARM64
mmap allocations.
This value can be used to select the number of bits to use to determine
ARCH_MMAP_RND_BITS=16 X86_32, ARM 4.5-4.20, 5.0-5.17 the random offset to the base address of vma regions resulting from
mmap allocations.
X86_32,
MICROCODE=Y 4.4-4.20, 5.0-5.17 For Mitigating CPU bugs
X86_64
X86_32,
X86_INTEL_UMIP=Y 4.15-4.20, 5.0-5.4 Same as X86_UMIP, prior to 5.5
X86_64
ARM, ARM64,
4.15-4.20, 5.0- This feature reduces the number of hardware side channels by ensuring
PAGE_TABLE_ISOLATION=Y X86_32,
5.17 that the majority of kernel addresses are not mapped into userspace.
X86_64
ARM64,
Protects thread_info structure address by moving it out of the
THREAD_INFO_IN_TASK=Y X86_32, 4.9-4.20, 5.0-5.17
stack and info task_struct.
X86_64
ARM, ARM64,
Generate a warning if any W+X mappings are found at boot.
DEBUG_WX=Y X86_32, 4.4-4.20, 5.0-5.17
Effectively reports any dangerous memory permissions.
X86_64
ARM, ARM64, Randomizes the freelist order used on creating new pages. This
SLAB_FREELIST_RANDOM=Y X86_32, 4.7-4.20, 5.0-5.17 security feature reduces the predictability of the kernel slab
X86_64 allocator against heap overflows.
ARM, ARM64,
Reduces the predictability of page allocations to compliment
SHUFFLE_PAGE_ALLOCATOR=Y X86_32, 5.2-5.17
SLAB_FREELIST_RANDOM
X86_64
ARM, ARM64, 2.6.19-2.6.39, 3.0- Additional validation check on commonly targeted structure.
DEBUG_LIST=Y X86_32, 3.19, 4.0-4.20, Enable this to turn on extended checks in the linked-list walking
X86_64 5.0-5.17 routines.
ARM, ARM64,
3.18-3.19, 4.0- Additional validation check on commonly targeted structure.
SCHED_STACK_END_CHECK=Y X86_32,
4.20, 5.0-5.17 Detect stack corruption on calls to schedule()
X86_64
All page allocator and slab allocator memory will be zeroed when
ARM, ARM64, allocated, eliminating many kinds of "uninitialized heap memory"
INIT_ON_ALLOC_DEFAULT_ON=Y X86_32, 5.3-5.17 flaws, especially heap content exposures. The performance
X86_64 impact varies by workload, but most cases see <1% impact. Some
synthetic workloads have measured as high as 7%.
2.6.24-2.6.39, 3.0-
Select this if you have a 32-bit processor and more than 4
HIGHMEM64G=Y X86_32 3.19, 4.0-4.20,
gigabytes of physical RAM.
5.0-5.17
ARM, ARM64,
RANDOM_TRUST_BOOTLOADER=is
X86_32, 5.4-5.17 Do not trust entropy generated by the bootloader
not set
X86_64
ARM, ARM64,
4.19-4.20, 5.0-
RANDOM_TRUST_CPU=is not set X86_32, Do not trust CPU manufacturer for initializating CRNG
5.17
X86_64
ARM64,
If this is set, STACKLEAK metrics for every task are available in
STACKLEAK_METRICS=is not set X86_32, 5.2-5.17
the /proc file system.
X86_64
ARM64,
STACKLEAK_RUNTIME_DISABLE=is
X86_32, 5.2-5.17 If set, allows runtime disabling of kernel stack erasing
not set
X86_64
ARM, ARM64,
Enables compiler plugins which can be used for
GCC_PLUGINS=Y X86_32, 4.8-4.20, 5.0-5.17
security hardening
X86_64
ARM, ARM64,
4.13-4.20, 5.0-
GCC_PLUGIN_RANDSTRUCT=Y X86_32, Randomizes layout of sensitive kernel structures
5.17
X86_64
ARM, ARM64,
GCC_PLUGIN_STRUCTLEAK_USER=Y X86_32, 5.2-5.17 Zero-init structs marked for userspace (weak)
X86_64
ARM, ARM64,
GCC_PLUGIN_STRUCTLEAK_BYREF=Y X86_32, 5.2-5.17 Zero-init structs passed by reference (strong)
X86_64
ARM, ARM64,
Zero-init anything passed by reference (very
GCC_PLUGIN_STRUCTLEAK_BYREF_ALL=Y X86_32, 5.2-5.17
strong)
X86_64
ARM, ARM64,
4.18-4.20, 5.0- Adds the CONFIG_STACKPROTECTOR canary logic to
STACKPROTECTOR_STRONG=Y X86_32,
5.17 additional conditions related to variable assignment.
X86_64
ARM, ARM64,
3.14-3.19, 4.0-
CC_STACKPROTECTOR=Y X86_32, Same as CONFIG_STACKPROTECTOR (prior to 4.18)
4.15
X86_64
ARM, ARM64,
3.14-3.19, 4.0- Same as CONFIG_STACKPROTECTOR_STRONG (prior to
CC_STACKPROTECTOR_STRONG=Y X86_32,
4.17 4.18)
X86_64
STACKPROTECTOR_PER_TASK=Y ARM, ARM64 5.0-5.17 Use a different stack canary value for each task
ARM, ARM64, You should not allow for modules to be loaded unless you have
MODULES=is not set X86_32, the proper signing and signature checks enabled. Allowing the
X86_64 kernel to load unsigned modules can be dangerous
ARM, ARM64, Module text and rodata memory will be made read-only, and
4.11-4.20, 5.0-
STRICT_MODULE_RWX=Y X86_32, non-text memory will be made non-executable. This provides
5.17
X86_64 protection against certain security exploits (e.g. writing to text)
ARM, ARM64,
3.7-3.19, 4.0-4.20,
MODULE_SIG=Y X86_32, Enable module signature verification
5.0-5.17
X86_64
ARM, ARM64,
3.9-3.19, 4.0-4.20, Automatically sign all modules during modules_install (so we
MODULE_SIG_ALL=Y X86_32,
5.0-5.17 don't have to do this manually)
X86_64
ARM, ARM64,
3.7-3.19, 4.0-4.20,
MODULE_SIG_FORCE=Y X86_32, Require modules to be validly signed
5.0-5.17
X86_64
2.5.50-2.5.75,
ARM, ARM64,
2.6.0-2.6.39, 3.0- This allows you to choose different security modules to be
SECURITY=Y X86_32,
3.19, 4.0-4.20, configured into your kernel.
X86_64
5.0-5.17
ARM, ARM64,
SECURITY_LOCKDOWN_LSM_EARLY=Y X86_32, 5.4-5.17 Enable lockdown LSM early in init
X86_64
ARM, ARM64,
Do not allow access to physical memory via
DEVMEM=is not set X86_32, 4.0-4.20, 5.0-5.17
/dev/mem
X86_64
2.5.73-2.5.75,
ARM, ARM64,
2.6.0-2.6.39, 3.0-
BINFMT_MISC=is not set X86_32, Do not allow wrapper-driven binary formats into the kernel
3.19, 4.0-4.20,
X86_64
5.0-5.17
ARM, ARM64,
3.17-3.19, 4.0-
KEXEC_FILE=is not set X86_32, Do not allow system to boot another Linux kernel
4.20, 5.0-5.17
X86_64
2.6.24-2.6.39, 3.0- If enabled, include code to run legacy 32-bit programs under a 64-bit
X86_32,
IA32_EMULATION=is not set 3.19, 4.0-4.20, kernel. You should likely turn this on, unless you're 100% sure that
X86_64
5.0-5.17 you don't have any 32-bit programs left.
If enabled, include code to run binaries for the x32 native 32-bit ABI
X86_32, 3.9-3.19, 4.0-4.20, for 64-bit processors. An x32 process gets access to the full 64-bit
X86_X32=is not set
X86_64 5.0-5.17 register file and wide data path while leaving pointers at 32 bits for
smaller memory footprint.
There will be no vsyscall mapping at all. This will eliminate any risk of
X86_32, ASLR bypass due to the vsyscall fixed address mapping. Attempts to
LEGACY_VSYSCALL_NONE=Y 4.4-4.20, 5.0-5.17
X86_64 use the vsyscalls will be reported to dmesg, so that either old or
malicious userspace programs can be identified.
Do not allow older ABI binaries to run on this kernel. If enabled, the
2.6.16-2.6.39, 3.0-
seccomp filter system will not be available, since there is no way yet
OABI_COMPAT=is not set ARM 3.19, 4.0-4.20,
to sensibly distinguish between legacy ABI and newer arm EABI
5.0-5.17
calling conventions during filtering.
ARM, ARM64, Do not enable memory allocator for compressed pages (slab-based
3.16-3.19, 4.0-
ZSMALLOC=is not set X86_32, memory allocator designed to store compressed RAM pages via
4.20, 5.0-5.17
X86_64 virtual memory mapping
ARM, ARM64,
If ZSMALLOC is enabled, be sure not to enable ZSMALLOC_STAT, as
ZSMALLOC_STAT=is not set X86_32, 4.0-4.20, 5.0-5.17
it may leak too much information about ZSMALLOC
X86_64
BINFMT_AOUT=is not ARM, ARM64, 2.5.73-2.5.75, 2.6.0-2.6.39, Do not enabled support for [Link]/ECOFF binaries. These are
set X86_32, X86_64 3.0-3.19, 4.0-4.20, 5.0-5.17 legacy formats. Everything should be ELF.
ARM, ARM64, 2.6.25-2.6.39, 3.0-3.19, 4.0- If enabled, kprobes allows you to trap at almost any kernel
KPROBES=is not set
X86_32, X86_64 4.20, 5.0-5.17 address and execute a callback function.
ARM, ARM64,
UPROBES=is not set 3.15-3.19, 4.0-4.20, 5.0-5.17 Uprobes is the user-space counterpart to kprobes
X86_32, X86_64
ARM, ARM64, If enabled, this allows the libc5 and earlier dynamic linker
USELIB=is not set 4.5-4.20, 5.0-5.17
X86_32, X86_64 usblib syscall. Should no longer be needed.
ARM, ARM64, Do not enable the userfaultfd() system call that allows to
USERFAULTFD=is not set 4.3-4.20, 5.0-5.17
X86_32, X86_64 intercept and handle page faults in userland.
HWPOISON_INJECT=is not ARM, ARM64, 2.6.33-2.6.39, 3.0-3.19, Do not enable the hwpoison injector, which intentionally
set X86_32, X86_64 4.0-4.20, 5.0-5.17 triggers a hwpoison memory failure
MEM_SOFT_DIRTY=is not ARM, ARM64, 3.11-3.19, 4.0-4.20, 5.0- Do not enable tracking of memory changes (by introducing a
set X86_32, X86_64 5.17 soft-dirty bit on pte-s)
ARM, ARM64,
DEVPORT=is not set 4.11-4.20, 5.0-5.17 Do not enable /dev/port interface
X86_32, X86_64
2.6.26-2.6.39, 3.0-
X86_32,
X86_PTDUMP=is not set 3.19, 4.0-4.4, 4.5- Export kernel pagetable layout to userspace via debugfs.
X86_64
4.20, 5.0-5.5, 5.5
ARM, ARM64,
PTDUMP_DEBUGFS=is not set X86_32, 5.6-5.17 Do not show the kernel pagetable layout in a debugfs file
X86_64
ARM, ARM64, Enable legacy DRI1 drivers. Those drivers expose unsafe and
DRM_LEGACY=is not set X86_32, 4.9-4.20, 5.0-5.17 dangerous APIs to user-space, which can be used to circumvent
X86_64 access restrictions and other security measures.
ARM, ARM64,
2.6.39, 3.0-3.19,
VT=is not set X86_32, Do not enable virtual terminal devices
4.0-4.20, 5.0-5.17
X86_64
ARM, ARM64, Potentially exploitable to gain root privileges. If enabled, this allows
3.9-3.19, 4.0-4.20,
USER_NS=is not set X86_32, containers to use user namespaces to provide different user info to
5.0-5.17
X86_64 each container.
X86_32, This enables the ioperm() and iopl() syscalls which are necessary
X86_IOPL_IOPERM=is not set 5.5-5.17
X86_64 for legacy applications.
ARM, ARM64,
Do not automatically load TTY line disciplines, as they could
LDISC_AUTOLOAD=is not set X86_32, 5.1-5.17
potentially be exploitable
X86_64
ARM, ARM64,
ACPI_TABLE_UPGRADE=is
X86_32, 4.7-4.20, 5.0-5.17 Do not allow ACPI tables to be passed in via initrd
not set
X86_64
ARM, ARM64,
EFI_TEST=is not set X86_32, 4.9-4.20, 5.0-5.17 Do not provide EFI Runtime Service Tests Support
X86_64
ARM, ARM64,
3.18-3.19, 4.0- Do not enable bpf() system call (to manipulate eBPF programs and maps)
BPF_SYSCALL=is not set X86_32,
4.20, 5.0-5.17 unless expliticitly necessary
X86_64
ARM, ARM64, 2.6.29-2.6.39, 3.0- Mmiotrace traces Memory Mapped I/O access and is meant for
MMIOTRACE=is not set X86_32, 3.19, 4.0-4.20, debugging and reverse engineering. It is called from the ioremap
X86_64 5.0-5.17 implementation and works via page faults.
ARM, ARM64,
LIVEPATCH=is not set X86_32, 4.0-4.20, 5.0-5.17 Do not support kernel live patching, as it could be exploitable
X86_64
ARM, ARM64,
3.9-3.19, 4.0-4.20,
IP_DCCP=is not set X86_32, Do not enable DCCP protocol unless explicitly needed
5.0-5.17
X86_64
ARM, ARM64,
3.8-3.19, 4.0-4.20,
IP_SCTP=is not set X86_32, Do not enable SCTP protocol unless explicitly needed
5.0-5.17
X86_64
ARM, ARM64,
VIDEO_VIVID=is not set X86_32, 5.17 Do not enable virtual video test driver
X86_64
2.5.45-2.5.75,
ARM, ARM64,
2.6.0-2.6.39, 3.0-
INPUT_EVBUG=is not set X86_32, Do not log input subsystem events (could be used as a keylogger, etc)
3.19, 4.0-4.20,
X86_64
5.0-5.17
ARM, ARM64,
PANIC_ON_OOPS=is not 3.5-3.19, 4.0-4.20, Reboot devices immediately if kernel experiences an Oops. (must also set
X86_32,
set 5.0-5.17 CONFIG_PANIC_TIMEOUT)
X86_64
ARM, ARM64,
3.14-3.19, 4.0- Reboot devices immediately if kernel experiences an Oops. (must also set
PANIC_TIMEOUT=-1 X86_32,
4.20, 5.0-5.17 CONFIG_PANIC_ON_OOPS)
X86_64
This option allows for unused exported symbols to be dropped from the
ARM, ARM64,
build. In turn, this provides the compiler more opportunities (especially
TRIM_UNUSED_KSYMS=Y X86_32, 4.7-4.20, 5.0-5.17
when using LTO) for optimizing the code and reducing binary size. This
X86_64
might have some security advantages as well.
2.5.45-2.5.75,
ARM, ARM64,
2.6.0-2.6.39, 3.0-
BLK_DEV_FD=is not set X86_32, This option enables the use of floppy disk drive(s) of your PC.
3.19, 4.0-4.20,
X86_64
5.0-5.17
This is a debug driver, which gets the power states of all Punit North
PUNIT_ATOM_DEBUG=is X86_32, Complex devices. The power states of each device is exposed as part of
4.2-4.20, 5.0-5.17
not set X86_64 the debugfs interface. The current power state can be read from
/sys/kernel/debug/punit_atom/dev_power_state
ARM, ARM64, Select this option to enable support for ACPI configuration from userspace.
ACPI_CONFIGFS=is not
X86_32, 4.8-4.20, 5.0-5.17 The configurable ACPI groups will be visible under /config/acpi, assuming
set
X86_64 configfs is mounted under /config.
X86_32, Choose this option to turn on extra driver debugging that may affect
DRM_I915_DEBUG=is not set 4.7-4.20, 5.0-5.17
X86_64 performance but will catch some internal issues.
ARM, ARM64, Keeps all active closures in a linked list and provides a debugfs
BCACHE_CLOSURES_DEBUG=is 3.10-3.19, 4.0-
X86_32, interface to list them, which makes it possible to see asynchronous
not set 4.20, 5.0-5.17
X86_64 operations that get stuck.
2.5.45-2.5.75,
ARM, ARM64, If your CPU cannot cache all of the physical memory in your
2.6.0-2.6.39, 3.0-
MTD_SLRAM=is not set X86_32, machine, you can still use it for storage or swap by using this driver
3.19, 4.0-4.20,
X86_64 to present it to the system as a Memory Technology Device.
5.0-5.17
ARM, ARM64,
4.11-4.20, 5.0- This allows the user to add tracing events (similar to tracepoints) on
KPROBE_EVENTS=is not set X86_32,
5.17 the fly via the ftrace interface.
X86_64
ARM, ARM64, This allows the user to add tracing events on top of userspace
4.11-4.20, 5.0-
UPROBE_EVENTS=is not set X86_32, dynamic events (similar to tracepoints) on the fly via the trace
5.17
X86_64 events interface.
ARM, ARM64, Allow one or more arbitrary trace event fields to be aggregated
HIST_TRIGGERS=is not set X86_32, 4.7-4.20, 5.0-5.17 into hash tables and dumped to stdout by reading a
X86_64 debugfs/tracefs file.
ARM, ARM64, 2.6.33-2.6.39, 3.0- Say Y here if you want to be able to trace the block layer actions
BLK_DEV_IO_TRACE=is not set X86_32, 3.19, 4.0-4.20, on a given queue. Tracing allows you to see any traffic happening
X86_64 5.0-5.17 on a block device queue.
ARM, ARM64,
FAIL_FUTEX=is not set X86_32, 4.3-4.20, 5.0-5.17 Provide fault-injection capability for futexes.
X86_64
ARM, ARM64,
KCOV exposes kernel code coverage information in a form
KCOV=is not set X86_32, 4.6-4.20, 5.0-5.17
suitable for coverage-guided fuzzing (randomized testing).
X86_64
There are inherent limitations and complexities that make IMA/EVM more
ARM, ARM64, 2.6.30-2.6.39, 3.0-
difficult to implement than DM_VERITY. Timesys suggests using DM_VERITY
IMA=Y X86_32, 3.19, 4.0-4.20,
instead. Filesystem Hardening (Integirty Measurement Architecture, file level)
X86_64 5.0-5.17
- Requires userspace support
There are inherent limitations and complexities that make IMA/EVM more
ARM, ARM64,
3.2-3.19, 4.0-4.20, difficult to implement than DM_VERITY. Timesys suggests using DM_VERITY
EVM=Y X86_32,
5.0-5.17 instead. Filesystem Hardening (Extended Verification Module, file level) -
X86_64
Requires userspace support
ARM, ARM64,
3.9-3.19, 4.0-4.20, Filesystem Hardening (Block Level Verification via dm-verity) - Requires
DM_VERITY=Y X86_32,
5.0-5.17 userspace support
X86_64