| .. | .. |
|---|
| 18 | 18 | select CRASH_CORE |
|---|
| 19 | 19 | bool |
|---|
| 20 | 20 | |
|---|
| 21 | +config KEXEC_ELF |
|---|
| 22 | + bool |
|---|
| 23 | + |
|---|
| 21 | 24 | config HAVE_IMA_KEXEC |
|---|
| 25 | + bool |
|---|
| 26 | + |
|---|
| 27 | +config SET_FS |
|---|
| 22 | 28 | bool |
|---|
| 23 | 29 | |
|---|
| 24 | 30 | config HOTPLUG_SMT |
|---|
| 25 | 31 | bool |
|---|
| 26 | 32 | |
|---|
| 33 | +config GENERIC_ENTRY |
|---|
| 34 | + bool |
|---|
| 35 | + |
|---|
| 27 | 36 | config OPROFILE |
|---|
| 28 | 37 | tristate "OProfile system profiling" |
|---|
| 29 | 38 | depends on PROFILING |
|---|
| 30 | 39 | depends on HAVE_OPROFILE |
|---|
| 31 | | - depends on !PREEMPT_RT_FULL |
|---|
| 32 | 40 | select RING_BUFFER |
|---|
| 33 | 41 | select RING_BUFFER_ALLOW_SWAP |
|---|
| 34 | 42 | help |
|---|
| .. | .. |
|---|
| 70 | 78 | If in doubt, say "N". |
|---|
| 71 | 79 | |
|---|
| 72 | 80 | config JUMP_LABEL |
|---|
| 73 | | - bool "Optimize very unlikely/likely branches" |
|---|
| 74 | | - depends on HAVE_ARCH_JUMP_LABEL |
|---|
| 75 | | - depends on CC_HAS_ASM_GOTO |
|---|
| 76 | | - help |
|---|
| 77 | | - This option enables a transparent branch optimization that |
|---|
| 81 | + bool "Optimize very unlikely/likely branches" |
|---|
| 82 | + depends on HAVE_ARCH_JUMP_LABEL |
|---|
| 83 | + depends on CC_HAS_ASM_GOTO |
|---|
| 84 | + help |
|---|
| 85 | + This option enables a transparent branch optimization that |
|---|
| 78 | 86 | makes certain almost-always-true or almost-always-false branch |
|---|
| 79 | 87 | conditions even cheaper to execute within the kernel. |
|---|
| 80 | 88 | |
|---|
| .. | .. |
|---|
| 82 | 90 | scheduler functionality, networking code and KVM have such |
|---|
| 83 | 91 | branches and include support for this optimization technique. |
|---|
| 84 | 92 | |
|---|
| 85 | | - If it is detected that the compiler has support for "asm goto", |
|---|
| 93 | + If it is detected that the compiler has support for "asm goto", |
|---|
| 86 | 94 | the kernel will compile such branches with just a nop |
|---|
| 87 | 95 | instruction. When the condition flag is toggled to true, the |
|---|
| 88 | 96 | nop will be converted to a jump instruction to execute the |
|---|
| .. | .. |
|---|
| 101 | 109 | help |
|---|
| 102 | 110 | Boot time self-test of the branch patching code. |
|---|
| 103 | 111 | |
|---|
| 112 | +config STATIC_CALL_SELFTEST |
|---|
| 113 | + bool "Static call selftest" |
|---|
| 114 | + depends on HAVE_STATIC_CALL |
|---|
| 115 | + help |
|---|
| 116 | + Boot time self-test of the call patching code. |
|---|
| 117 | + |
|---|
| 104 | 118 | config OPTPROBES |
|---|
| 105 | 119 | def_bool y |
|---|
| 106 | 120 | depends on KPROBES && HAVE_OPTPROBES |
|---|
| 107 | | - select TASKS_RCU if PREEMPT |
|---|
| 121 | + select TASKS_RCU if PREEMPTION |
|---|
| 108 | 122 | |
|---|
| 109 | 123 | config KPROBES_ON_FTRACE |
|---|
| 110 | 124 | def_bool y |
|---|
| .. | .. |
|---|
| 161 | 175 | problems with received packets if doing so would not help |
|---|
| 162 | 176 | much. |
|---|
| 163 | 177 | |
|---|
| 164 | | - See Documentation/unaligned-memory-access.txt for more |
|---|
| 178 | + See Documentation/core-api/unaligned-memory-access.rst for more |
|---|
| 165 | 179 | information on the topic of unaligned memory accesses. |
|---|
| 166 | 180 | |
|---|
| 167 | 181 | config ARCH_USE_BUILTIN_BSWAP |
|---|
| 168 | | - bool |
|---|
| 169 | | - help |
|---|
| 182 | + bool |
|---|
| 183 | + help |
|---|
| 170 | 184 | Modern versions of GCC (since 4.4) have builtin functions |
|---|
| 171 | 185 | for handling byte-swapping. Using these, instead of the old |
|---|
| 172 | 186 | inline assembler that the architecture code provides in the |
|---|
| .. | .. |
|---|
| 235 | 249 | bool |
|---|
| 236 | 250 | |
|---|
| 237 | 251 | config GENERIC_SMP_IDLE_THREAD |
|---|
| 238 | | - bool |
|---|
| 252 | + bool |
|---|
| 239 | 253 | |
|---|
| 240 | 254 | config GENERIC_IDLE_POLL_SETUP |
|---|
| 241 | | - bool |
|---|
| 255 | + bool |
|---|
| 242 | 256 | |
|---|
| 243 | 257 | config ARCH_HAS_FORTIFY_SOURCE |
|---|
| 244 | 258 | bool |
|---|
| .. | .. |
|---|
| 246 | 260 | An architecture should select this when it can successfully |
|---|
| 247 | 261 | build and run with CONFIG_FORTIFY_SOURCE. |
|---|
| 248 | 262 | |
|---|
| 263 | +# |
|---|
| 264 | +# Select if the arch provides a historic keepinit alias for the retain_initrd |
|---|
| 265 | +# command line option |
|---|
| 266 | +# |
|---|
| 267 | +config ARCH_HAS_KEEPINITRD |
|---|
| 268 | + bool |
|---|
| 269 | + |
|---|
| 249 | 270 | # Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h |
|---|
| 250 | 271 | config ARCH_HAS_SET_MEMORY |
|---|
| 251 | 272 | bool |
|---|
| 252 | 273 | |
|---|
| 274 | +# Select if arch has all set_direct_map_invalid/default() functions |
|---|
| 275 | +config ARCH_HAS_SET_DIRECT_MAP |
|---|
| 276 | + bool |
|---|
| 277 | + |
|---|
| 278 | +# |
|---|
| 279 | +# Select if the architecture provides the arch_dma_set_uncached symbol to |
|---|
| 280 | +# either provide an uncached segement alias for a DMA allocation, or |
|---|
| 281 | +# to remap the page tables in place. |
|---|
| 282 | +# |
|---|
| 283 | +config ARCH_HAS_DMA_SET_UNCACHED |
|---|
| 284 | + bool |
|---|
| 285 | + |
|---|
| 286 | +# |
|---|
| 287 | +# Select if the architectures provides the arch_dma_clear_uncached symbol |
|---|
| 288 | +# to undo an in-place page table remap for uncached access. |
|---|
| 289 | +# |
|---|
| 290 | +config ARCH_HAS_DMA_CLEAR_UNCACHED |
|---|
| 291 | + bool |
|---|
| 292 | + |
|---|
| 293 | +config ARCH_HAS_CPU_FINALIZE_INIT |
|---|
| 294 | + bool |
|---|
| 295 | + |
|---|
| 253 | 296 | # Select if arch init_task must go in the __init_task_data section |
|---|
| 254 | 297 | config ARCH_TASK_STRUCT_ON_STACK |
|---|
| 255 | | - bool |
|---|
| 298 | + bool |
|---|
| 256 | 299 | |
|---|
| 257 | 300 | # Select if arch has its private alloc_task_struct() function |
|---|
| 258 | 301 | config ARCH_TASK_STRUCT_ALLOCATOR |
|---|
| .. | .. |
|---|
| 277 | 320 | config ARCH_WANTS_DYNAMIC_TASK_STRUCT |
|---|
| 278 | 321 | bool |
|---|
| 279 | 322 | |
|---|
| 323 | +config ARCH_32BIT_OFF_T |
|---|
| 324 | + bool |
|---|
| 325 | + depends on !64BIT |
|---|
| 326 | + help |
|---|
| 327 | + All new 32-bit architectures should have 64-bit off_t type on |
|---|
| 328 | + userspace side which corresponds to the loff_t kernel type. This |
|---|
| 329 | + is the requirement for modern ABIs. Some existing architectures |
|---|
| 330 | + still support 32-bit off_t. This option is enabled for all such |
|---|
| 331 | + architectures explicitly. |
|---|
| 332 | + |
|---|
| 333 | +config HAVE_ASM_MODVERSIONS |
|---|
| 334 | + bool |
|---|
| 335 | + help |
|---|
| 336 | + This symbol should be selected by an architecure if it provides |
|---|
| 337 | + <asm/asm-prototypes.h> to support the module versioning for symbols |
|---|
| 338 | + exported from assembly code. |
|---|
| 339 | + |
|---|
| 280 | 340 | config HAVE_REGS_AND_STACK_ACCESS_API |
|---|
| 281 | 341 | bool |
|---|
| 282 | 342 | help |
|---|
| .. | .. |
|---|
| 292 | 352 | This symbol should be selected by an architecture if it |
|---|
| 293 | 353 | supports an implementation of restartable sequences. |
|---|
| 294 | 354 | |
|---|
| 295 | | -config HAVE_CLK |
|---|
| 355 | +config HAVE_FUNCTION_ARG_ACCESS_API |
|---|
| 296 | 356 | bool |
|---|
| 297 | 357 | help |
|---|
| 298 | | - The <linux/clk.h> calls support software clock gating and |
|---|
| 299 | | - thus are a key power management tool on many systems. |
|---|
| 358 | + This symbol should be selected by an architecure if it supports |
|---|
| 359 | + the API needed to access function arguments from pt_regs, |
|---|
| 360 | + declared in asm/ptrace.h |
|---|
| 300 | 361 | |
|---|
| 301 | 362 | config HAVE_HW_BREAKPOINT |
|---|
| 302 | 363 | bool |
|---|
| .. | .. |
|---|
| 361 | 422 | config HAVE_ARCH_JUMP_LABEL |
|---|
| 362 | 423 | bool |
|---|
| 363 | 424 | |
|---|
| 364 | | -config HAVE_RCU_TABLE_FREE |
|---|
| 425 | +config HAVE_ARCH_JUMP_LABEL_RELATIVE |
|---|
| 365 | 426 | bool |
|---|
| 366 | 427 | |
|---|
| 367 | | -config HAVE_RCU_TABLE_INVALIDATE |
|---|
| 428 | +config MMU_GATHER_TABLE_FREE |
|---|
| 368 | 429 | bool |
|---|
| 430 | + |
|---|
| 431 | +config MMU_GATHER_RCU_TABLE_FREE |
|---|
| 432 | + bool |
|---|
| 433 | + select MMU_GATHER_TABLE_FREE |
|---|
| 434 | + |
|---|
| 435 | +config MMU_GATHER_PAGE_SIZE |
|---|
| 436 | + bool |
|---|
| 437 | + |
|---|
| 438 | +config MMU_GATHER_NO_RANGE |
|---|
| 439 | + bool |
|---|
| 440 | + |
|---|
| 441 | +config MMU_GATHER_NO_GATHER |
|---|
| 442 | + bool |
|---|
| 443 | + depends on MMU_GATHER_TABLE_FREE |
|---|
| 369 | 444 | |
|---|
| 370 | 445 | config ARCH_WANT_IRQS_OFF_ACTIVATE_MM |
|---|
| 371 | 446 | bool |
|---|
| .. | .. |
|---|
| 404 | 479 | select ARCH_WANT_COMPAT_IPC_PARSE_VERSION |
|---|
| 405 | 480 | bool |
|---|
| 406 | 481 | |
|---|
| 407 | | -config HAVE_ARCH_SECCOMP_FILTER |
|---|
| 482 | +config HAVE_ARCH_SECCOMP |
|---|
| 408 | 483 | bool |
|---|
| 409 | 484 | help |
|---|
| 485 | + An arch should select this symbol to support seccomp mode 1 (the fixed |
|---|
| 486 | + syscall policy), and must provide an overrides for __NR_seccomp_sigreturn, |
|---|
| 487 | + and compat syscalls if the asm-generic/seccomp.h defaults need adjustment: |
|---|
| 488 | + - __NR_seccomp_read_32 |
|---|
| 489 | + - __NR_seccomp_write_32 |
|---|
| 490 | + - __NR_seccomp_exit_32 |
|---|
| 491 | + - __NR_seccomp_sigreturn_32 |
|---|
| 492 | + |
|---|
| 493 | +config HAVE_ARCH_SECCOMP_FILTER |
|---|
| 494 | + bool |
|---|
| 495 | + select HAVE_ARCH_SECCOMP |
|---|
| 496 | + help |
|---|
| 410 | 497 | An arch should select this symbol if it provides all of these things: |
|---|
| 498 | + - all the requirements for HAVE_ARCH_SECCOMP |
|---|
| 411 | 499 | - syscall_get_arch() |
|---|
| 412 | 500 | - syscall_get_arguments() |
|---|
| 413 | 501 | - syscall_rollback() |
|---|
| .. | .. |
|---|
| 417 | 505 | - secure_computing return value is checked and a return value of -1 |
|---|
| 418 | 506 | results in the system call being skipped immediately. |
|---|
| 419 | 507 | - seccomp syscall wired up |
|---|
| 508 | + |
|---|
| 509 | +config SECCOMP |
|---|
| 510 | + prompt "Enable seccomp to safely execute untrusted bytecode" |
|---|
| 511 | + def_bool y |
|---|
| 512 | + depends on HAVE_ARCH_SECCOMP |
|---|
| 513 | + help |
|---|
| 514 | + This kernel feature is useful for number crunching applications |
|---|
| 515 | + that may need to handle untrusted bytecode during their |
|---|
| 516 | + execution. By using pipes or other transports made available |
|---|
| 517 | + to the process as file descriptors supporting the read/write |
|---|
| 518 | + syscalls, it's possible to isolate those applications in their |
|---|
| 519 | + own address space using seccomp. Once seccomp is enabled via |
|---|
| 520 | + prctl(PR_SET_SECCOMP) or the seccomp() syscall, it cannot be |
|---|
| 521 | + disabled and the task is only allowed to execute a few safe |
|---|
| 522 | + syscalls defined by each seccomp mode. |
|---|
| 523 | + |
|---|
| 524 | + If unsure, say Y. |
|---|
| 420 | 525 | |
|---|
| 421 | 526 | config SECCOMP_FILTER |
|---|
| 422 | 527 | def_bool y |
|---|
| .. | .. |
|---|
| 428 | 533 | |
|---|
| 429 | 534 | See Documentation/userspace-api/seccomp_filter.rst for details. |
|---|
| 430 | 535 | |
|---|
| 536 | +config HAVE_ARCH_STACKLEAK |
|---|
| 537 | + bool |
|---|
| 538 | + help |
|---|
| 539 | + An architecture should select this if it has the code which |
|---|
| 540 | + fills the used part of the kernel stack with the STACKLEAK_POISON |
|---|
| 541 | + value before returning from system calls. |
|---|
| 542 | + |
|---|
| 431 | 543 | config HAVE_STACKPROTECTOR |
|---|
| 432 | 544 | bool |
|---|
| 433 | 545 | help |
|---|
| 434 | 546 | An arch should select this symbol if: |
|---|
| 435 | 547 | - it has implemented a stack canary (e.g. __stack_chk_guard) |
|---|
| 436 | | - |
|---|
| 437 | | -config CC_HAS_STACKPROTECTOR_NONE |
|---|
| 438 | | - def_bool $(cc-option,-fno-stack-protector) |
|---|
| 439 | 548 | |
|---|
| 440 | 549 | config STACKPROTECTOR |
|---|
| 441 | 550 | bool "Stack Protector buffer overflow detection" |
|---|
| .. | .. |
|---|
| 483 | 592 | about 20% of all kernel functions, which increases the kernel code |
|---|
| 484 | 593 | size by about 2%. |
|---|
| 485 | 594 | |
|---|
| 595 | +config ARCH_SUPPORTS_SHADOW_CALL_STACK |
|---|
| 596 | + bool |
|---|
| 597 | + help |
|---|
| 598 | + An architecture should select this if it supports Clang's Shadow |
|---|
| 599 | + Call Stack and implements runtime support for shadow stack |
|---|
| 600 | + switching. |
|---|
| 601 | + |
|---|
| 602 | +config SHADOW_CALL_STACK |
|---|
| 603 | + bool "Clang Shadow Call Stack" |
|---|
| 604 | + depends on CC_IS_CLANG && ARCH_SUPPORTS_SHADOW_CALL_STACK |
|---|
| 605 | + depends on DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER |
|---|
| 606 | + help |
|---|
| 607 | + This option enables Clang's Shadow Call Stack, which uses a |
|---|
| 608 | + shadow stack to protect function return addresses from being |
|---|
| 609 | + overwritten by an attacker. More information can be found in |
|---|
| 610 | + Clang's documentation: |
|---|
| 611 | + |
|---|
| 612 | + https://clang.llvm.org/docs/ShadowCallStack.html |
|---|
| 613 | + |
|---|
| 614 | + Note that security guarantees in the kernel differ from the |
|---|
| 615 | + ones documented for user space. The kernel must store addresses |
|---|
| 616 | + of shadow stacks in memory, which means an attacker capable of |
|---|
| 617 | + reading and writing arbitrary memory may be able to locate them |
|---|
| 618 | + and hijack control flow by modifying the stacks. |
|---|
| 619 | + |
|---|
| 486 | 620 | config LTO |
|---|
| 487 | | - def_bool n |
|---|
| 621 | + bool |
|---|
| 622 | + help |
|---|
| 623 | + Selected if the kernel will be built using the compiler's LTO feature. |
|---|
| 624 | + |
|---|
| 625 | +config LTO_CLANG |
|---|
| 626 | + bool |
|---|
| 627 | + select LTO |
|---|
| 628 | + help |
|---|
| 629 | + Selected if the kernel will be built using Clang's LTO feature. |
|---|
| 488 | 630 | |
|---|
| 489 | 631 | config ARCH_SUPPORTS_LTO_CLANG |
|---|
| 490 | 632 | bool |
|---|
| 491 | 633 | help |
|---|
| 492 | 634 | An architecture should select this option if it supports: |
|---|
| 493 | | - - compiling with clang, |
|---|
| 494 | | - - compiling inline assembly with clang's integrated assembler, |
|---|
| 635 | + - compiling with Clang, |
|---|
| 636 | + - compiling inline assembly with Clang's integrated assembler, |
|---|
| 495 | 637 | - and linking with LLD. |
|---|
| 496 | 638 | |
|---|
| 497 | | -config ARCH_SUPPORTS_THINLTO |
|---|
| 639 | +config ARCH_SUPPORTS_LTO_CLANG_THIN |
|---|
| 498 | 640 | bool |
|---|
| 499 | 641 | help |
|---|
| 500 | | - An architecture should select this if it supports clang's ThinLTO. |
|---|
| 642 | + An architecture should select this option if it can support Clang's |
|---|
| 643 | + ThinLTO mode. |
|---|
| 501 | 644 | |
|---|
| 502 | | -config THINLTO |
|---|
| 503 | | - bool "Use clang ThinLTO (EXPERIMENTAL)" |
|---|
| 504 | | - depends on LTO_CLANG && ARCH_SUPPORTS_THINLTO |
|---|
| 505 | | - default y |
|---|
| 645 | +config HAS_LTO_CLANG |
|---|
| 646 | + def_bool y |
|---|
| 647 | + # Clang >= 11: https://github.com/ClangBuiltLinux/linux/issues/510 |
|---|
| 648 | + depends on CC_IS_CLANG && CLANG_VERSION >= 110000 && LD_IS_LLD |
|---|
| 649 | + depends on $(success,test $(LLVM) -eq 1) |
|---|
| 650 | + depends on $(success,test $(LLVM_IAS) -eq 1) |
|---|
| 651 | + depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm) |
|---|
| 652 | + depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm) |
|---|
| 653 | + depends on ARCH_SUPPORTS_LTO_CLANG |
|---|
| 654 | + depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT |
|---|
| 655 | + depends on !KASAN || KASAN_HW_TAGS |
|---|
| 656 | + depends on !GCOV_KERNEL |
|---|
| 506 | 657 | help |
|---|
| 507 | | - Use ThinLTO to speed up Link Time Optimization. |
|---|
| 658 | + The compiler and Kconfig options support building with Clang's |
|---|
| 659 | + LTO. |
|---|
| 508 | 660 | |
|---|
| 509 | 661 | choice |
|---|
| 510 | | - prompt "Link-Time Optimization (LTO) (EXPERIMENTAL)" |
|---|
| 662 | + prompt "Link Time Optimization (LTO)" |
|---|
| 511 | 663 | default LTO_NONE |
|---|
| 512 | 664 | help |
|---|
| 513 | | - This option turns on Link-Time Optimization (LTO). |
|---|
| 665 | + This option enables Link Time Optimization (LTO), which allows the |
|---|
| 666 | + compiler to optimize binaries globally. |
|---|
| 667 | + |
|---|
| 668 | + If unsure, select LTO_NONE. Note that LTO is very resource-intensive |
|---|
| 669 | + so it's disabled by default. |
|---|
| 514 | 670 | |
|---|
| 515 | 671 | config LTO_NONE |
|---|
| 516 | 672 | bool "None" |
|---|
| 517 | | - |
|---|
| 518 | | -config LTO_CLANG |
|---|
| 519 | | - bool "Use clang Link Time Optimization (LTO) (EXPERIMENTAL)" |
|---|
| 520 | | - depends on ARCH_SUPPORTS_LTO_CLANG |
|---|
| 521 | | - depends on !FTRACE_MCOUNT_RECORD || HAVE_C_RECORDMCOUNT |
|---|
| 522 | | - depends on !KASAN |
|---|
| 523 | | - depends on CC_IS_CLANG && LD_IS_LLD |
|---|
| 524 | | - select LTO |
|---|
| 525 | 673 | help |
|---|
| 526 | | - This option enables clang's Link Time Optimization (LTO), which allows |
|---|
| 527 | | - the compiler to optimize the kernel globally at link time. If you |
|---|
| 528 | | - enable this option, the compiler generates LLVM IR instead of object |
|---|
| 529 | | - files, and the actual compilation from IR occurs at the LTO link step, |
|---|
| 530 | | - which may take several minutes. |
|---|
| 674 | + Build the kernel normally, without Link Time Optimization (LTO). |
|---|
| 531 | 675 | |
|---|
| 532 | | - If you select this option, you must compile the kernel with clang and |
|---|
| 533 | | - LLD. |
|---|
| 676 | +config LTO_CLANG_FULL |
|---|
| 677 | + bool "Clang Full LTO (EXPERIMENTAL)" |
|---|
| 678 | + depends on HAS_LTO_CLANG |
|---|
| 679 | + depends on !COMPILE_TEST |
|---|
| 680 | + select LTO_CLANG |
|---|
| 681 | + help |
|---|
| 682 | + This option enables Clang's full Link Time Optimization (LTO), which |
|---|
| 683 | + allows the compiler to optimize the kernel globally. If you enable |
|---|
| 684 | + this option, the compiler generates LLVM bitcode instead of ELF |
|---|
| 685 | + object files, and the actual compilation from bitcode happens at |
|---|
| 686 | + the LTO link step, which may take several minutes depending on the |
|---|
| 687 | + kernel configuration. More information can be found from LLVM's |
|---|
| 688 | + documentation: |
|---|
| 534 | 689 | |
|---|
| 690 | + https://llvm.org/docs/LinkTimeOptimization.html |
|---|
| 691 | + |
|---|
| 692 | + During link time, this option can use a large amount of RAM, and |
|---|
| 693 | + may take much longer than the ThinLTO option. |
|---|
| 694 | + |
|---|
| 695 | +config LTO_CLANG_THIN |
|---|
| 696 | + bool "Clang ThinLTO (EXPERIMENTAL)" |
|---|
| 697 | + depends on HAS_LTO_CLANG && ARCH_SUPPORTS_LTO_CLANG_THIN |
|---|
| 698 | + select LTO_CLANG |
|---|
| 699 | + help |
|---|
| 700 | + This option enables Clang's ThinLTO, which allows for parallel |
|---|
| 701 | + optimization and faster incremental compiles compared to the |
|---|
| 702 | + CONFIG_LTO_CLANG_FULL option. More information can be found |
|---|
| 703 | + from Clang's documentation: |
|---|
| 704 | + |
|---|
| 705 | + https://clang.llvm.org/docs/ThinLTO.html |
|---|
| 706 | + |
|---|
| 707 | + If unsure, say Y. |
|---|
| 535 | 708 | endchoice |
|---|
| 536 | 709 | |
|---|
| 537 | | -config CFI |
|---|
| 538 | | - bool |
|---|
| 539 | | - |
|---|
| 540 | | -config CFI_PERMISSIVE |
|---|
| 541 | | - bool "Use CFI in permissive mode" |
|---|
| 542 | | - depends on CFI |
|---|
| 543 | | - help |
|---|
| 544 | | - When selected, Control Flow Integrity (CFI) violations result in a |
|---|
| 545 | | - warning instead of a kernel panic. This option is useful for finding |
|---|
| 546 | | - CFI violations in drivers during development. |
|---|
| 547 | | - |
|---|
| 548 | 710 | config CFI_CLANG |
|---|
| 549 | | - bool "Use clang Control Flow Integrity (CFI) (EXPERIMENTAL)" |
|---|
| 550 | | - depends on LTO_CLANG |
|---|
| 551 | | - depends on KALLSYMS |
|---|
| 552 | | - select CFI |
|---|
| 711 | + bool "Use Clang's Control Flow Integrity (CFI)" |
|---|
| 712 | + depends on LTO_CLANG && KALLSYMS |
|---|
| 553 | 713 | help |
|---|
| 554 | | - This option enables clang Control Flow Integrity (CFI), which adds |
|---|
| 714 | + This option enables Clang's Control Flow Integrity (CFI), which adds |
|---|
| 555 | 715 | runtime checking for indirect function calls. |
|---|
| 556 | 716 | |
|---|
| 557 | 717 | config CFI_CLANG_SHADOW |
|---|
| 558 | 718 | bool "Use CFI shadow to speed up cross-module checks" |
|---|
| 559 | 719 | default y |
|---|
| 560 | | - depends on CFI_CLANG |
|---|
| 720 | + depends on CFI_CLANG && MODULES |
|---|
| 561 | 721 | help |
|---|
| 562 | 722 | If you select this option, the kernel builds a fast look-up table of |
|---|
| 563 | 723 | CFI check functions in loaded modules to reduce overhead. |
|---|
| 564 | 724 | |
|---|
| 565 | | -config ARCH_SUPPORTS_SHADOW_CALL_STACK |
|---|
| 566 | | - bool |
|---|
| 725 | +config CFI_PERMISSIVE |
|---|
| 726 | + bool "Use CFI in permissive mode" |
|---|
| 727 | + depends on CFI_CLANG |
|---|
| 567 | 728 | help |
|---|
| 568 | | - An architecture should select this if it supports Clang's Shadow |
|---|
| 569 | | - Call Stack, has asm/scs.h, and implements runtime support for shadow |
|---|
| 570 | | - stack switching. |
|---|
| 571 | | - |
|---|
| 572 | | -config SHADOW_CALL_STACK |
|---|
| 573 | | - bool "Clang Shadow Call Stack" |
|---|
| 574 | | - depends on ARCH_SUPPORTS_SHADOW_CALL_STACK |
|---|
| 575 | | - help |
|---|
| 576 | | - This option enables Clang's Shadow Call Stack, which uses a |
|---|
| 577 | | - shadow stack to protect function return addresses from being |
|---|
| 578 | | - overwritten by an attacker. More information can be found from |
|---|
| 579 | | - Clang's documentation: |
|---|
| 580 | | - |
|---|
| 581 | | - https://clang.llvm.org/docs/ShadowCallStack.html |
|---|
| 582 | | - |
|---|
| 583 | | - Note that security guarantees in the kernel differ from the ones |
|---|
| 584 | | - documented for user space. The kernel must store addresses of shadow |
|---|
| 585 | | - stacks used by other tasks and interrupt handlers in memory, which |
|---|
| 586 | | - means an attacker capable reading and writing arbitrary memory may |
|---|
| 587 | | - be able to locate them and hijack control flow by modifying shadow |
|---|
| 588 | | - stacks that are not currently in use. |
|---|
| 589 | | - |
|---|
| 590 | | -config SHADOW_CALL_STACK_VMAP |
|---|
| 591 | | - bool "Use virtually mapped shadow call stacks" |
|---|
| 592 | | - depends on SHADOW_CALL_STACK |
|---|
| 593 | | - help |
|---|
| 594 | | - Use virtually mapped shadow call stacks. Selecting this option |
|---|
| 595 | | - provides better stack exhaustion protection, but increases per-thread |
|---|
| 596 | | - memory consumption as a full page is allocated for each shadow stack. |
|---|
| 729 | + When selected, Control Flow Integrity (CFI) violations result in a |
|---|
| 730 | + warning instead of a kernel panic. This option is useful for finding |
|---|
| 731 | + CFI violations during development. |
|---|
| 597 | 732 | |
|---|
| 598 | 733 | config HAVE_ARCH_WITHIN_STACK_FRAMES |
|---|
| 599 | 734 | bool |
|---|
| .. | .. |
|---|
| 609 | 744 | help |
|---|
| 610 | 745 | Provide kernel/user boundaries probes necessary for subsystems |
|---|
| 611 | 746 | that need it, such as userspace RCU extended quiescent state. |
|---|
| 612 | | - Syscalls need to be wrapped inside user_exit()-user_enter() through |
|---|
| 613 | | - the slow path using TIF_NOHZ flag. Exceptions handlers must be |
|---|
| 614 | | - wrapped as well. Irqs are already protected inside |
|---|
| 615 | | - rcu_irq_enter/rcu_irq_exit() but preemption or signal handling on |
|---|
| 616 | | - irq exit still need to be protected. |
|---|
| 747 | + Syscalls need to be wrapped inside user_exit()-user_enter(), either |
|---|
| 748 | + optimized behind static key or through the slow path using TIF_NOHZ |
|---|
| 749 | + flag. Exceptions handlers must be wrapped as well. Irqs are already |
|---|
| 750 | + protected inside rcu_irq_enter/rcu_irq_exit() but preemption or signal |
|---|
| 751 | + handling on irq exit still need to be protected. |
|---|
| 752 | + |
|---|
| 753 | +config HAVE_TIF_NOHZ |
|---|
| 754 | + bool |
|---|
| 755 | + help |
|---|
| 756 | + Arch relies on TIF_NOHZ and syscall slow path to implement context |
|---|
| 757 | + tracking calls to user_enter()/user_exit(). |
|---|
| 617 | 758 | |
|---|
| 618 | 759 | config HAVE_VIRT_CPU_ACCOUNTING |
|---|
| 619 | 760 | bool |
|---|
| .. | .. |
|---|
| 639 | 780 | Archs need to ensure they use a high enough resolution clock to |
|---|
| 640 | 781 | support irq time accounting and then call enable_sched_clock_irqtime(). |
|---|
| 641 | 782 | |
|---|
| 783 | +config HAVE_MOVE_PUD |
|---|
| 784 | + bool |
|---|
| 785 | + help |
|---|
| 786 | + Architectures that select this are able to move page tables at the |
|---|
| 787 | + PUD level. If there are only 3 page table levels, the move effectively |
|---|
| 788 | + happens at the PGD level. |
|---|
| 789 | + |
|---|
| 790 | +config HAVE_MOVE_PMD |
|---|
| 791 | + bool |
|---|
| 792 | + help |
|---|
| 793 | + Archs that select this are able to move page tables at the PMD level. |
|---|
| 794 | + |
|---|
| 642 | 795 | config HAVE_ARCH_TRANSPARENT_HUGEPAGE |
|---|
| 643 | 796 | bool |
|---|
| 644 | 797 | |
|---|
| .. | .. |
|---|
| 646 | 799 | bool |
|---|
| 647 | 800 | |
|---|
| 648 | 801 | config HAVE_ARCH_HUGE_VMAP |
|---|
| 802 | + bool |
|---|
| 803 | + |
|---|
| 804 | +config ARCH_WANT_HUGE_PMD_SHARE |
|---|
| 649 | 805 | bool |
|---|
| 650 | 806 | |
|---|
| 651 | 807 | config HAVE_ARCH_SOFT_DIRTY |
|---|
| .. | .. |
|---|
| 772 | 928 | and vice-versa 32-bit applications to call 64-bit mmap(). |
|---|
| 773 | 929 | Required for applications doing different bitness syscalls. |
|---|
| 774 | 930 | |
|---|
| 775 | | -config HAVE_COPY_THREAD_TLS |
|---|
| 931 | +# This allows to use a set of generic functions to determine mmap base |
|---|
| 932 | +# address by giving priority to top-down scheme only if the process |
|---|
| 933 | +# is not in legacy mode (compat task, unlimited stack size or |
|---|
| 934 | +# sysctl_legacy_va_layout). |
|---|
| 935 | +# Architecture that selects this option can provide its own version of: |
|---|
| 936 | +# - STACK_RND_MASK |
|---|
| 937 | +config ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT |
|---|
| 776 | 938 | bool |
|---|
| 777 | | - help |
|---|
| 778 | | - Architecture provides copy_thread_tls to accept tls argument via |
|---|
| 779 | | - normal C parameter passing, rather than extracting the syscall |
|---|
| 780 | | - argument from pt_regs. |
|---|
| 939 | + depends on MMU |
|---|
| 940 | + select ARCH_HAS_ELF_RANDOMIZE |
|---|
| 781 | 941 | |
|---|
| 782 | 942 | config HAVE_STACK_VALIDATION |
|---|
| 783 | 943 | bool |
|---|
| .. | .. |
|---|
| 788 | 948 | config HAVE_RELIABLE_STACKTRACE |
|---|
| 789 | 949 | bool |
|---|
| 790 | 950 | help |
|---|
| 791 | | - Architecture has a save_stack_trace_tsk_reliable() function which |
|---|
| 792 | | - only returns a stack trace if it can guarantee the trace is reliable. |
|---|
| 951 | + Architecture has either save_stack_trace_tsk_reliable() or |
|---|
| 952 | + arch_stack_walk_reliable() function which only returns a stack trace |
|---|
| 953 | + if it can guarantee the trace is reliable. |
|---|
| 793 | 954 | |
|---|
| 794 | 955 | config HAVE_ARCH_HASH |
|---|
| 795 | 956 | bool |
|---|
| .. | .. |
|---|
| 798 | 959 | If this is set, the architecture provides an <asm/hash.h> |
|---|
| 799 | 960 | file which provides platform-specific implementations of some |
|---|
| 800 | 961 | functions in <linux/hash.h> or fs/namei.c. |
|---|
| 962 | + |
|---|
| 963 | +config HAVE_ARCH_NVRAM_OPS |
|---|
| 964 | + bool |
|---|
| 801 | 965 | |
|---|
| 802 | 966 | config ISA_BUS_API |
|---|
| 803 | 967 | def_bool ISA |
|---|
| .. | .. |
|---|
| 848 | 1012 | config COMPAT_OLD_SIGACTION |
|---|
| 849 | 1013 | bool |
|---|
| 850 | 1014 | |
|---|
| 851 | | -config 64BIT_TIME |
|---|
| 852 | | - def_bool ARCH_HAS_64BIT_TIME |
|---|
| 853 | | - help |
|---|
| 854 | | - This should be selected by all architectures that need to support |
|---|
| 855 | | - new system calls with a 64-bit time_t. This is relevant on all 32-bit |
|---|
| 856 | | - architectures, and 64-bit architectures as part of compat syscall |
|---|
| 857 | | - handling. |
|---|
| 858 | | - |
|---|
| 859 | 1015 | config COMPAT_32BIT_TIME |
|---|
| 860 | | - def_bool (!64BIT && 64BIT_TIME) || COMPAT |
|---|
| 1016 | + bool "Provide system calls for 32-bit time_t" |
|---|
| 1017 | + default !64BIT || COMPAT |
|---|
| 861 | 1018 | help |
|---|
| 862 | 1019 | This enables 32 bit time_t support in addition to 64 bit time_t support. |
|---|
| 863 | 1020 | This is relevant on all 32-bit architectures, and 64-bit architectures |
|---|
| 864 | 1021 | as part of compat syscall handling. |
|---|
| 865 | 1022 | |
|---|
| 866 | | -config ARCH_NO_COHERENT_DMA_MMAP |
|---|
| 1023 | +config ARCH_NO_PREEMPT |
|---|
| 867 | 1024 | bool |
|---|
| 868 | 1025 | |
|---|
| 869 | | -config ARCH_NO_PREEMPT |
|---|
| 1026 | +config ARCH_SUPPORTS_RT |
|---|
| 870 | 1027 | bool |
|---|
| 871 | 1028 | |
|---|
| 872 | 1029 | config CPU_NO_EFFICIENT_FFS |
|---|
| .. | .. |
|---|
| 895 | 1052 | config VMAP_STACK |
|---|
| 896 | 1053 | default y |
|---|
| 897 | 1054 | bool "Use a virtually-mapped stack" |
|---|
| 898 | | - depends on HAVE_ARCH_VMAP_STACK && !KASAN |
|---|
| 899 | | - ---help--- |
|---|
| 1055 | + depends on HAVE_ARCH_VMAP_STACK |
|---|
| 1056 | + depends on !KASAN || KASAN_HW_TAGS || KASAN_VMALLOC |
|---|
| 1057 | + help |
|---|
| 900 | 1058 | Enable this if you want the use virtually-mapped kernel stacks |
|---|
| 901 | 1059 | with guard pages. This causes kernel stack overflows to be |
|---|
| 902 | 1060 | caught immediately rather than causing difficult-to-diagnose |
|---|
| 903 | 1061 | corruption. |
|---|
| 904 | 1062 | |
|---|
| 905 | | - This is presently incompatible with KASAN because KASAN expects |
|---|
| 906 | | - the stack to map directly to the KASAN shadow map using a formula |
|---|
| 907 | | - that is incorrect if the stack is in vmalloc space. |
|---|
| 1063 | + To use this with software KASAN modes, the architecture must support |
|---|
| 1064 | + backing virtual mappings with real shadow memory, and KASAN_VMALLOC |
|---|
| 1065 | + must be enabled. |
|---|
| 908 | 1066 | |
|---|
| 909 | 1067 | config ARCH_OPTIONAL_KERNEL_RWX |
|---|
| 910 | 1068 | def_bool n |
|---|
| .. | .. |
|---|
| 944 | 1102 | config ARCH_HAS_PHYS_TO_DMA |
|---|
| 945 | 1103 | bool |
|---|
| 946 | 1104 | |
|---|
| 947 | | -config ARCH_HAS_REFCOUNT |
|---|
| 948 | | - bool |
|---|
| 949 | | - help |
|---|
| 950 | | - An architecture selects this when it has implemented refcount_t |
|---|
| 951 | | - using open coded assembly primitives that provide an optimized |
|---|
| 952 | | - refcount_t implementation, possibly at the expense of some full |
|---|
| 953 | | - refcount state checks of CONFIG_REFCOUNT_FULL=y. |
|---|
| 954 | | - |
|---|
| 955 | | - The refcount overflow check behavior, however, must be retained. |
|---|
| 956 | | - Catching overflows is the primary security concern for protecting |
|---|
| 957 | | - against bugs in reference counts. |
|---|
| 958 | | - |
|---|
| 959 | | -config REFCOUNT_FULL |
|---|
| 960 | | - bool "Perform full reference count validation at the expense of speed" |
|---|
| 961 | | - help |
|---|
| 962 | | - Enabling this switches the refcounting infrastructure from a fast |
|---|
| 963 | | - unchecked atomic_t implementation to a fully state checked |
|---|
| 964 | | - implementation, which can be (slightly) slower but provides protections |
|---|
| 965 | | - against various use-after-free conditions that can be used in |
|---|
| 966 | | - security flaw exploits. |
|---|
| 967 | | - |
|---|
| 968 | 1105 | config HAVE_ARCH_COMPILER_H |
|---|
| 969 | 1106 | bool |
|---|
| 970 | 1107 | help |
|---|
| .. | .. |
|---|
| 986 | 1123 | config ARCH_USE_MEMREMAP_PROT |
|---|
| 987 | 1124 | bool |
|---|
| 988 | 1125 | |
|---|
| 1126 | +config LOCK_EVENT_COUNTS |
|---|
| 1127 | + bool "Locking event counts collection" |
|---|
| 1128 | + depends on DEBUG_FS |
|---|
| 1129 | + help |
|---|
| 1130 | + Enable light-weight counting of various locking related events |
|---|
| 1131 | + in the system with minimal performance impact. This reduces |
|---|
| 1132 | + the chance of application behavior change because of timing |
|---|
| 1133 | + differences. The counts are reported via debugfs. |
|---|
| 1134 | + |
|---|
| 989 | 1135 | # Select if the architecture has support for applying RELR relocations. |
|---|
| 990 | 1136 | config ARCH_HAS_RELR |
|---|
| 991 | 1137 | bool |
|---|
| .. | .. |
|---|
| 1000 | 1146 | well as compatible NM and OBJCOPY utilities (llvm-nm and llvm-objcopy |
|---|
| 1001 | 1147 | are compatible). |
|---|
| 1002 | 1148 | |
|---|
| 1149 | +config ARCH_HAS_MEM_ENCRYPT |
|---|
| 1150 | + bool |
|---|
| 1151 | + |
|---|
| 1152 | +config ARCH_HAS_CC_PLATFORM |
|---|
| 1153 | + bool |
|---|
| 1154 | + |
|---|
| 1155 | +config HAVE_SPARSE_SYSCALL_NR |
|---|
| 1156 | + bool |
|---|
| 1157 | + help |
|---|
| 1158 | + An architecture should select this if its syscall numbering is sparse |
|---|
| 1159 | + to save space. For example, MIPS architecture has a syscall array with |
|---|
| 1160 | + entries at 4000, 5000 and 6000 locations. This option turns on syscall |
|---|
| 1161 | + related optimizations for a given architecture. |
|---|
| 1162 | + |
|---|
| 1163 | +config ARCH_HAS_VDSO_DATA |
|---|
| 1164 | + bool |
|---|
| 1165 | + |
|---|
| 1166 | +config HAVE_STATIC_CALL |
|---|
| 1167 | + bool |
|---|
| 1168 | + |
|---|
| 1169 | +config HAVE_STATIC_CALL_INLINE |
|---|
| 1170 | + bool |
|---|
| 1171 | + depends on HAVE_STATIC_CALL |
|---|
| 1172 | + |
|---|
| 1173 | +config ARCH_WANT_LD_ORPHAN_WARN |
|---|
| 1174 | + bool |
|---|
| 1175 | + help |
|---|
| 1176 | + An arch should select this symbol once all linker sections are explicitly |
|---|
| 1177 | + included, size-asserted, or discarded in the linker scripts. This is |
|---|
| 1178 | + important because we never want expected sections to be placed heuristically |
|---|
| 1179 | + by the linker, since the locations of such sections can change between linker |
|---|
| 1180 | + versions. |
|---|
| 1181 | + |
|---|
| 1182 | +config ARCH_SPLIT_ARG64 |
|---|
| 1183 | + bool |
|---|
| 1184 | + help |
|---|
| 1185 | + If a 32-bit architecture requires 64-bit arguments to be split into |
|---|
| 1186 | + pairs of 32-bit arguments, select this option. |
|---|
| 1187 | + |
|---|
| 1003 | 1188 | source "kernel/gcov/Kconfig" |
|---|
| 1004 | 1189 | |
|---|
| 1005 | 1190 | source "scripts/gcc-plugins/Kconfig" |
|---|