1 # Linux/i386 6.6.7 Kernel Configuration
3 # Report BUG() conditions and kill the offending process.
6 # Make sure kernel page tables have safe permissions.
7 CONFIG_STRICT_KERNEL_RWX=y
9 # Report any dangerous memory permissions (not available on all archs).
12 # Use -fstack-protector-strong (gcc 4.9+) for best stack canary coverage.
13 # Prior to v4.18, these are:
14 # CONFIG_CC_STACKPROTECTOR=y
15 # CONFIG_CC_STACKPROTECTOR_STRONG=y
16 CONFIG_STACKPROTECTOR=y
17 CONFIG_STACKPROTECTOR_STRONG=y
19 # Do not allow direct physical memory access (but if you must have it, at least enable STRICT mode...)
20 # CONFIG_DEVMEM is not set
21 CONFIG_STRICT_DEVMEM=y
22 CONFIG_IO_STRICT_DEVMEM=y
24 # Provides some protections against SYN flooding.
27 # Perform additional validation of various commonly targeted structures.
28 CONFIG_DEBUG_CREDENTIALS=y
29 CONFIG_DEBUG_NOTIFIERS=y
32 CONFIG_DEBUG_VIRTUAL=y
33 CONFIG_BUG_ON_DATA_CORRUPTION=y
34 CONFIG_SCHED_STACK_END_CHECK=y
36 # Provide userspace with seccomp BPF API for syscall attack surface reduction.
38 CONFIG_SECCOMP_FILTER=y
40 # Make sure line disciplines can't be autoloaded (since v5.1).
41 # CONFIG_LDISC_AUTOLOAD is not set
43 # Provide userspace with ptrace ancestry protections.
44 # Make sure that "yama" is also present in the "CONFIG_LSM=yama,..." list.
46 CONFIG_SECURITY_YAMA=y
48 # Provide userspace with Landlock MAC interface.
49 # Make sure that "landlock" is also present in the "CONFIG_LSM=landlock,..." list.
50 CONFIG_SECURITY_LANDLOCK=y
52 # Make sure SELinux cannot be disabled trivially.
53 # CONFIG_SECURITY_SELINUX_BOOTPARAM is not set
54 # CONFIG_SECURITY_SELINUX_DEVELOP is not set
55 # CONFIG_SECURITY_WRITABLE_HOOKS is not set
57 # Enable "lockdown" LSM for bright line between the root user and kernel memory.
58 CONFIG_SECURITY_LOCKDOWN_LSM=y
59 CONFIG_SECURITY_LOCKDOWN_LSM_EARLY=y
60 CONFIG_LOCK_DOWN_KERNEL_FORCE_CONFIDENTIALITY=y
62 # Perform usercopy bounds checking. (And disable fallback to gain full whitelist enforcement.)
63 CONFIG_HARDENED_USERCOPY=y
64 # CONFIG_HARDENED_USERCOPY_FALLBACK is not set
65 # CONFIG_HARDENED_USERCOPY_PAGESPAN is not set
67 # Randomize allocator freelists, harden metadata.
68 CONFIG_SLAB_FREELIST_RANDOM=y
69 CONFIG_SLAB_FREELIST_HARDENED=y
71 # Allow for randomization of high-order page allocation freelist. Must be enabled with
72 # the "page_alloc.shuffle=1" command line below).
73 CONFIG_SHUFFLE_PAGE_ALLOCATOR=y
75 # Allow allocator validation checking to be enabled (see "slub_debug=P" below).
78 # Wipe higher-level memory allocations when they are freed (needs "page_poison=1" command line below).
79 # (If you can afford even more performance penalty, leave CONFIG_PAGE_POISONING_NO_SANITY=n)
80 CONFIG_PAGE_POISONING=y
81 CONFIG_PAGE_POISONING_NO_SANITY=y
82 CONFIG_PAGE_POISONING_ZERO=y
84 # Wipe slab and page allocations (since v5.3)
85 # Instead of "slub_debug=P" and "page_poison=1", a single place can control memory allocation wiping now.
86 # The init_on_free is only needed if there is concern about minimizing stale data lifetime.
87 CONFIG_INIT_ON_ALLOC_DEFAULT_ON=y
88 CONFIG_INIT_ON_FREE_DEFAULT_ON=y
90 # Initialize all stack variables on function entry. (Clang and GCC 12+ builds only. For earlier GCC, see CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL=y below)
91 CONFIG_INIT_STACK_ALL_ZERO=y
93 # Adds guard pages to kernel stacks (not all architectures support this yet).
96 # Perform extensive checks on reference counting.
97 CONFIG_REFCOUNT_FULL=y
99 # Check for memory copies that might overflow a structure in str*() and mem*() functions both at build-time and run-time.
100 CONFIG_FORTIFY_SOURCE=y
102 # Avoid kernel memory address exposures via dmesg (sets sysctl kernel.dmesg_restrict initial value to 1)
103 CONFIG_SECURITY_DMESG_RESTRICT=y
105 # Enable trapping bounds checking of array indexes (since v5.11). All the other UBSAN checks should be disabled.
108 CONFIG_UBSAN_BOUNDS=y
109 CONFIG_UBSAN_SANITIZE_ALL=y
110 # CONFIG_UBSAN_SHIFT is not set
111 # CONFIG_UBSAN_DIV_ZERO is not set
112 # CONFIG_UBSAN_UNREACHABLE is not set
113 # CONFIG_UBSAN_BOOL is not set
114 # CONFIG_UBSAN_ENUM is not set
115 # CONFIG_UBSAN_ALIGNMENT is not set
116 # This is only available on Clang builds, and is likely already enabled if CONFIG_UBSAN_BOUNDS=y is set:
117 CONFIG_UBSAN_LOCAL_BOUNDS=y
119 # Enable sampling-based overflow detection (since v5.12). This is similar to KASAN coverage, but with almost zero runtime overhead.
122 # Randomize kernel stack offset on syscall entry (since v5.13).
123 CONFIG_RANDOMIZE_KSTACK_OFFSET_DEFAULT=y
125 # Do not ignore compile-time warnings (since v5.15)
128 # Disable DMA between EFI hand-off and the kernel's IOMMU setup.
129 CONFIG_EFI_DISABLE_PCI_DMA=y
131 # Force IOMMU TLB invalidation so devices will never be able to access stale data contents (or set "iommu.passthrough=0 iommu.strict=1" at boot)
132 CONFIG_IOMMU_SUPPORT=y
133 CONFIG_IOMMU_DEFAULT_DMA_STRICT=y
135 # Enable feeding RNG entropy from TPM, if available.
136 CONFIG_HW_RANDOM_TPM=y
138 # Get as much entropy as possible from external sources. The Chacha mixer isn't vulnerable to injected entropy, so even
139 # malicious sources should not cause problems.
140 CONFIG_RANDOM_TRUST_BOOTLOADER=y
141 CONFIG_RANDOM_TRUST_CPU=y
143 # Make scheduler aware of SMT Cores. Program needs to opt-in to using this feature with prctl(PR_SCHED_CORE).
146 # Wipe all caller-used registers on exit from the function (reduces available ROP gadgets and
147 # minimizes stale data in registers). (Since v5.15)
148 CONFIG_ZERO_CALL_USED_REGS=y
150 # Wipe RAM at reboot via EFI.
151 # For more details, see:
152 # https://trustedcomputinggroup.org/resource/pc-client-work-group-platform-reset-attack-mitigation-specification/
153 # https://bugzilla.redhat.com/show_bug.cgi?id=1532058
154 CONFIG_RESET_ATTACK_MITIGATION=y
156 # This needs userspace support, and will break "regular" distros. See: https://github.com/tych0/huldufolk
157 CONFIG_STATIC_USERMODEHELPER=y
159 # Dangerous; enabling this allows direct physical memory writing.
160 # CONFIG_ACPI_CUSTOM_METHOD is not set
162 # Dangerous; enabling this disables brk ASLR.
163 # CONFIG_COMPAT_BRK is not set
165 # Dangerous; enabling this allows direct kernel memory writing.
166 # CONFIG_DEVKMEM is not set
168 # Dangerous; exposes kernel text image layout.
169 # CONFIG_PROC_KCORE is not set
171 # Dangerous; enabling this disables VDSO ASLR.
172 # CONFIG_COMPAT_VDSO is not set
174 # Dangerous; enabling this allows replacement of running kernel.
175 # CONFIG_KEXEC is not set
177 # Dangerous; enabling this allows replacement of running kernel.
178 # CONFIG_HIBERNATION is not set
180 # Prior to v4.1, assists heap memory attacks; best to keep interface disabled.
181 # CONFIG_INET_DIAG is not set
183 # Easily confused by misconfigured userspace, keep off.
184 # CONFIG_BINFMT_MISC is not set
186 # Use the modern PTY interface (devpts) only.
187 # CONFIG_LEGACY_PTYS is not set
189 # Block TTY stuffing attacks (this will break screen readers, see "dev.tty.legacy_tiocsti" sysctl below).
190 # CONFIG_LEGACY_TIOCSTI is not set
192 # If SELinux can be disabled at runtime, the LSM structures cannot be read-only; keep off.
193 # CONFIG_SECURITY_SELINUX_DISABLE is not set
195 # Reboot devices immediately if kernel experiences an Oops.
196 CONFIG_PANIC_ON_OOPS=y
197 CONFIG_PANIC_TIMEOUT=-1
199 # Keep root from altering kernel memory via loadable modules.
200 # CONFIG_MODULES is not set
202 # But if CONFIG_MODULE=y is needed, at least they must be signed with a per-build key.
203 CONFIG_STRICT_MODULE_RWX=y
205 CONFIG_MODULE_SIG_FORCE=y
206 CONFIG_MODULE_SIG_ALL=y
207 CONFIG_MODULE_SIG_SHA512=y
208 CONFIG_MODULE_SIG_HASH="sha512"
209 CONFIG_MODULE_SIG_KEY="certs/signing_key.pem"
216 # Gather additional entropy at boot time for systems that may not have appropriate entropy sources.
217 CONFIG_GCC_PLUGIN_LATENT_ENTROPY=y
219 # Force all structures to be initialized before they are passed to other functions.
220 # When building with GCC:
221 CONFIG_GCC_PLUGIN_STRUCTLEAK=y
222 CONFIG_GCC_PLUGIN_STRUCTLEAK_BYREF_ALL=y
224 # Wipe stack contents on syscall exit (reduces stale data lifetime in stack)
225 CONFIG_GCC_PLUGIN_STACKLEAK=y
226 # CONFIG_STACKLEAK_METRICS is not set
227 # CONFIG_STACKLEAK_RUNTIME_DISABLE is not set
229 # Randomize the layout of system structures. This may have dramatic performance impact, so
230 # use with caution or also use CONFIG_GCC_PLUGIN_RANDSTRUCT_PERFORMANCE=y
231 CONFIG_GCC_PLUGIN_RANDSTRUCT=y
232 # CONFIG_GCC_PLUGIN_RANDSTRUCT_PERFORMANCE is not set
238 # On 32-bit kernels, require PAE for NX bit support.
239 # CONFIG_M486 is not set
240 # CONFIG_HIGHMEM4G is not set
244 # Disallow allocating the first 64k of memory.
245 CONFIG_DEFAULT_MMAP_MIN_ADDR=65536
247 # Disable Model-Specific Register writes.
248 # CONFIG_X86_MSR is not set
250 # Randomize position of kernel.
251 CONFIG_RANDOMIZE_BASE=y
253 # Enable Kernel Page Table Isolation to remove an entire class of cache timing side-channels.
254 CONFIG_PAGE_TABLE_ISOLATION=y
256 # Enable chip-specific IOMMU support.
258 CONFIG_INTEL_IOMMU_DEFAULT_ON=y
260 # Don't allow for 16-bit program emulation and associated LDT tricks.
261 # CONFIG_MODIFY_LDT_SYSCALL is not set