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