Kconfig 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150
  1. # SPDX-License-Identifier: GPL-2.0
  2. #
  3. # General architecture dependent options
  4. #
  5. config CRASH_CORE
  6. bool
  7. config KEXEC_CORE
  8. select CRASH_CORE
  9. bool
  10. config HAVE_IMA_KEXEC
  11. bool
  12. config HOTPLUG_SMT
  13. bool
  14. config OPROFILE
  15. tristate "OProfile system profiling"
  16. depends on PROFILING
  17. depends on HAVE_OPROFILE
  18. select RING_BUFFER
  19. select RING_BUFFER_ALLOW_SWAP
  20. help
  21. OProfile is a profiling system capable of profiling the
  22. whole system, include the kernel, kernel modules, libraries,
  23. and applications.
  24. If unsure, say N.
  25. config OPROFILE_EVENT_MULTIPLEX
  26. bool "OProfile multiplexing support (EXPERIMENTAL)"
  27. default n
  28. depends on OPROFILE && X86
  29. help
  30. The number of hardware counters is limited. The multiplexing
  31. feature enables OProfile to gather more events than counters
  32. are provided by the hardware. This is realized by switching
  33. between events at a user specified time interval.
  34. If unsure, say N.
  35. config HAVE_OPROFILE
  36. bool
  37. config OPROFILE_NMI_TIMER
  38. def_bool y
  39. depends on PERF_EVENTS && HAVE_PERF_EVENTS_NMI && !PPC64
  40. config KPROBES
  41. bool "Kprobes"
  42. depends on MODULES
  43. depends on HAVE_KPROBES
  44. select KALLSYMS
  45. help
  46. Kprobes allows you to trap at almost any kernel address and
  47. execute a callback function. register_kprobe() establishes
  48. a probepoint and specifies the callback. Kprobes is useful
  49. for kernel debugging, non-intrusive instrumentation and testing.
  50. If in doubt, say "N".
  51. config JUMP_LABEL
  52. bool "Optimize very unlikely/likely branches"
  53. depends on HAVE_ARCH_JUMP_LABEL
  54. help
  55. This option enables a transparent branch optimization that
  56. makes certain almost-always-true or almost-always-false branch
  57. conditions even cheaper to execute within the kernel.
  58. Certain performance-sensitive kernel code, such as trace points,
  59. scheduler functionality, networking code and KVM have such
  60. branches and include support for this optimization technique.
  61. If it is detected that the compiler has support for "asm goto",
  62. the kernel will compile such branches with just a nop
  63. instruction. When the condition flag is toggled to true, the
  64. nop will be converted to a jump instruction to execute the
  65. conditional block of instructions.
  66. This technique lowers overhead and stress on the branch prediction
  67. of the processor and generally makes the kernel faster. The update
  68. of the condition is slower, but those are always very rare.
  69. ( On 32-bit x86, the necessary options added to the compiler
  70. flags may increase the size of the kernel slightly. )
  71. config STATIC_KEYS_SELFTEST
  72. bool "Static key selftest"
  73. depends on JUMP_LABEL
  74. help
  75. Boot time self-test of the branch patching code.
  76. config OPTPROBES
  77. def_bool y
  78. depends on KPROBES && HAVE_OPTPROBES
  79. select TASKS_RCU if PREEMPT
  80. config KPROBES_ON_FTRACE
  81. def_bool y
  82. depends on KPROBES && HAVE_KPROBES_ON_FTRACE
  83. depends on DYNAMIC_FTRACE_WITH_REGS
  84. help
  85. If function tracer is enabled and the arch supports full
  86. passing of pt_regs to function tracing, then kprobes can
  87. optimize on top of function tracing.
  88. config UPROBES
  89. def_bool n
  90. depends on ARCH_SUPPORTS_UPROBES
  91. help
  92. Uprobes is the user-space counterpart to kprobes: they
  93. enable instrumentation applications (such as 'perf probe')
  94. to establish unintrusive probes in user-space binaries and
  95. libraries, by executing handler functions when the probes
  96. are hit by user-space applications.
  97. ( These probes come in the form of single-byte breakpoints,
  98. managed by the kernel and kept transparent to the probed
  99. application. )
  100. config HAVE_64BIT_ALIGNED_ACCESS
  101. def_bool 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS
  102. help
  103. Some architectures require 64 bit accesses to be 64 bit
  104. aligned, which also requires structs containing 64 bit values
  105. to be 64 bit aligned too. This includes some 32 bit
  106. architectures which can do 64 bit accesses, as well as 64 bit
  107. architectures without unaligned access.
  108. This symbol should be selected by an architecture if 64 bit
  109. accesses are required to be 64 bit aligned in this way even
  110. though it is not a 64 bit architecture.
  111. See Documentation/unaligned-memory-access.txt for more
  112. information on the topic of unaligned memory accesses.
  113. config HAVE_EFFICIENT_UNALIGNED_ACCESS
  114. bool
  115. help
  116. Some architectures are unable to perform unaligned accesses
  117. without the use of get_unaligned/put_unaligned. Others are
  118. unable to perform such accesses efficiently (e.g. trap on
  119. unaligned access and require fixing it up in the exception
  120. handler.)
  121. This symbol should be selected by an architecture if it can
  122. perform unaligned accesses efficiently to allow different
  123. code paths to be selected for these cases. Some network
  124. drivers, for example, could opt to not fix up alignment
  125. problems with received packets if doing so would not help
  126. much.
  127. See Documentation/unaligned-memory-access.txt for more
  128. information on the topic of unaligned memory accesses.
  129. config ARCH_USE_BUILTIN_BSWAP
  130. bool
  131. help
  132. Modern versions of GCC (since 4.4) have builtin functions
  133. for handling byte-swapping. Using these, instead of the old
  134. inline assembler that the architecture code provides in the
  135. __arch_bswapXX() macros, allows the compiler to see what's
  136. happening and offers more opportunity for optimisation. In
  137. particular, the compiler will be able to combine the byteswap
  138. with a nearby load or store and use load-and-swap or
  139. store-and-swap instructions if the architecture has them. It
  140. should almost *never* result in code which is worse than the
  141. hand-coded assembler in <asm/swab.h>. But just in case it
  142. does, the use of the builtins is optional.
  143. Any architecture with load-and-swap or store-and-swap
  144. instructions should set this. And it shouldn't hurt to set it
  145. on architectures that don't have such instructions.
  146. config KRETPROBES
  147. def_bool y
  148. depends on KPROBES && HAVE_KRETPROBES
  149. config USER_RETURN_NOTIFIER
  150. bool
  151. depends on HAVE_USER_RETURN_NOTIFIER
  152. help
  153. Provide a kernel-internal notification when a cpu is about to
  154. switch to user mode.
  155. config HAVE_IOREMAP_PROT
  156. bool
  157. config HAVE_KPROBES
  158. bool
  159. config HAVE_KRETPROBES
  160. bool
  161. config HAVE_OPTPROBES
  162. bool
  163. config HAVE_KPROBES_ON_FTRACE
  164. bool
  165. config HAVE_NMI
  166. bool
  167. #
  168. # An arch should select this if it provides all these things:
  169. #
  170. # task_pt_regs() in asm/processor.h or asm/ptrace.h
  171. # arch_has_single_step() if there is hardware single-step support
  172. # arch_has_block_step() if there is hardware block-step support
  173. # asm/syscall.h supplying asm-generic/syscall.h interface
  174. # linux/regset.h user_regset interfaces
  175. # CORE_DUMP_USE_REGSET #define'd in linux/elf.h
  176. # TIF_SYSCALL_TRACE calls tracehook_report_syscall_{entry,exit}
  177. # TIF_NOTIFY_RESUME calls tracehook_notify_resume()
  178. # signal delivery calls tracehook_signal_handler()
  179. #
  180. config HAVE_ARCH_TRACEHOOK
  181. bool
  182. config HAVE_DMA_CONTIGUOUS
  183. bool
  184. config GENERIC_SMP_IDLE_THREAD
  185. bool
  186. config GENERIC_IDLE_POLL_SETUP
  187. bool
  188. config ARCH_HAS_FORTIFY_SOURCE
  189. bool
  190. help
  191. An architecture should select this when it can successfully
  192. build and run with CONFIG_FORTIFY_SOURCE.
  193. # Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h
  194. config ARCH_HAS_SET_MEMORY
  195. bool
  196. # Select if arch init_task initializer is different to init/init_task.c
  197. config ARCH_INIT_TASK
  198. bool
  199. # Select if arch has its private alloc_task_struct() function
  200. config ARCH_TASK_STRUCT_ALLOCATOR
  201. bool
  202. # Select if arch has its private alloc_thread_stack() function
  203. config ARCH_THREAD_STACK_ALLOCATOR
  204. bool
  205. # Select if arch wants to size task_struct dynamically via arch_task_struct_size:
  206. config ARCH_WANTS_DYNAMIC_TASK_STRUCT
  207. bool
  208. config HAVE_REGS_AND_STACK_ACCESS_API
  209. bool
  210. help
  211. This symbol should be selected by an architecure if it supports
  212. the API needed to access registers and stack entries from pt_regs,
  213. declared in asm/ptrace.h
  214. For example the kprobes-based event tracer needs this API.
  215. config HAVE_CLK
  216. bool
  217. help
  218. The <linux/clk.h> calls support software clock gating and
  219. thus are a key power management tool on many systems.
  220. config HAVE_DMA_API_DEBUG
  221. bool
  222. config HAVE_HW_BREAKPOINT
  223. bool
  224. depends on PERF_EVENTS
  225. config HAVE_MIXED_BREAKPOINTS_REGS
  226. bool
  227. depends on HAVE_HW_BREAKPOINT
  228. help
  229. Depending on the arch implementation of hardware breakpoints,
  230. some of them have separate registers for data and instruction
  231. breakpoints addresses, others have mixed registers to store
  232. them but define the access type in a control register.
  233. Select this option if your arch implements breakpoints under the
  234. latter fashion.
  235. config HAVE_USER_RETURN_NOTIFIER
  236. bool
  237. config HAVE_PERF_EVENTS_NMI
  238. bool
  239. help
  240. System hardware can generate an NMI using the perf event
  241. subsystem. Also has support for calculating CPU cycle events
  242. to determine how many clock cycles in a given period.
  243. config HAVE_HARDLOCKUP_DETECTOR_PERF
  244. bool
  245. depends on HAVE_PERF_EVENTS_NMI
  246. help
  247. The arch chooses to use the generic perf-NMI-based hardlockup
  248. detector. Must define HAVE_PERF_EVENTS_NMI.
  249. config HAVE_NMI_WATCHDOG
  250. depends on HAVE_NMI
  251. bool
  252. help
  253. The arch provides a low level NMI watchdog. It provides
  254. asm/nmi.h, and defines its own arch_touch_nmi_watchdog().
  255. config HAVE_HARDLOCKUP_DETECTOR_ARCH
  256. bool
  257. select HAVE_NMI_WATCHDOG
  258. help
  259. The arch chooses to provide its own hardlockup detector, which is
  260. a superset of the HAVE_NMI_WATCHDOG. It also conforms to config
  261. interfaces and parameters provided by hardlockup detector subsystem.
  262. config HAVE_PERF_REGS
  263. bool
  264. help
  265. Support selective register dumps for perf events. This includes
  266. bit-mapping of each registers and a unique architecture id.
  267. config HAVE_PERF_USER_STACK_DUMP
  268. bool
  269. help
  270. Support user stack dumps for perf event samples. This needs
  271. access to the user stack pointer which is not unified across
  272. architectures.
  273. config HAVE_ARCH_JUMP_LABEL
  274. bool
  275. config HAVE_RCU_TABLE_FREE
  276. bool
  277. config HAVE_RCU_TABLE_INVALIDATE
  278. bool
  279. config ARCH_WANT_IRQS_OFF_ACTIVATE_MM
  280. bool
  281. help
  282. Temporary select until all architectures can be converted to have
  283. irqs disabled over activate_mm. Architectures that do IPI based TLB
  284. shootdowns should enable this.
  285. config ARCH_HAVE_NMI_SAFE_CMPXCHG
  286. bool
  287. config HAVE_ALIGNED_STRUCT_PAGE
  288. bool
  289. help
  290. This makes sure that struct pages are double word aligned and that
  291. e.g. the SLUB allocator can perform double word atomic operations
  292. on a struct page for better performance. However selecting this
  293. might increase the size of a struct page by a word.
  294. config HAVE_CMPXCHG_LOCAL
  295. bool
  296. config HAVE_CMPXCHG_DOUBLE
  297. bool
  298. config ARCH_WEAK_RELEASE_ACQUIRE
  299. bool
  300. config ARCH_WANT_IPC_PARSE_VERSION
  301. bool
  302. config ARCH_WANT_COMPAT_IPC_PARSE_VERSION
  303. bool
  304. config ARCH_WANT_OLD_COMPAT_IPC
  305. select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
  306. bool
  307. config HAVE_ARCH_SECCOMP_FILTER
  308. bool
  309. help
  310. An arch should select this symbol if it provides all of these things:
  311. - syscall_get_arch()
  312. - syscall_get_arguments()
  313. - syscall_rollback()
  314. - syscall_set_return_value()
  315. - SIGSYS siginfo_t support
  316. - secure_computing is called from a ptrace_event()-safe context
  317. - secure_computing return value is checked and a return value of -1
  318. results in the system call being skipped immediately.
  319. - seccomp syscall wired up
  320. config SECCOMP_FILTER
  321. def_bool y
  322. depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
  323. help
  324. Enable tasks to build secure computing environments defined
  325. in terms of Berkeley Packet Filter programs which implement
  326. task-defined system call filtering polices.
  327. See Documentation/prctl/seccomp_filter.txt for details.
  328. config HAVE_GCC_PLUGINS
  329. bool
  330. help
  331. An arch should select this symbol if it supports building with
  332. GCC plugins.
  333. menuconfig GCC_PLUGINS
  334. bool "GCC plugins"
  335. depends on HAVE_GCC_PLUGINS
  336. depends on !COMPILE_TEST
  337. help
  338. GCC plugins are loadable modules that provide extra features to the
  339. compiler. They are useful for runtime instrumentation and static analysis.
  340. See Documentation/gcc-plugins.txt for details.
  341. config GCC_PLUGIN_CYC_COMPLEXITY
  342. bool "Compute the cyclomatic complexity of a function" if EXPERT
  343. depends on GCC_PLUGINS
  344. depends on !COMPILE_TEST
  345. help
  346. The complexity M of a function's control flow graph is defined as:
  347. M = E - N + 2P
  348. where
  349. E = the number of edges
  350. N = the number of nodes
  351. P = the number of connected components (exit nodes).
  352. Enabling this plugin reports the complexity to stderr during the
  353. build. It mainly serves as a simple example of how to create a
  354. gcc plugin for the kernel.
  355. config GCC_PLUGIN_SANCOV
  356. bool
  357. depends on GCC_PLUGINS
  358. help
  359. This plugin inserts a __sanitizer_cov_trace_pc() call at the start of
  360. basic blocks. It supports all gcc versions with plugin support (from
  361. gcc-4.5 on). It is based on the commit "Add fuzzing coverage support"
  362. by Dmitry Vyukov <dvyukov@google.com>.
  363. config GCC_PLUGIN_LATENT_ENTROPY
  364. bool "Generate some entropy during boot and runtime"
  365. depends on GCC_PLUGINS
  366. help
  367. By saying Y here the kernel will instrument some kernel code to
  368. extract some entropy from both original and artificially created
  369. program state. This will help especially embedded systems where
  370. there is little 'natural' source of entropy normally. The cost
  371. is some slowdown of the boot process (about 0.5%) and fork and
  372. irq processing.
  373. Note that entropy extracted this way is not cryptographically
  374. secure!
  375. This plugin was ported from grsecurity/PaX. More information at:
  376. * https://grsecurity.net/
  377. * https://pax.grsecurity.net/
  378. config GCC_PLUGIN_STRUCTLEAK
  379. bool "Force initialization of variables containing userspace addresses"
  380. depends on GCC_PLUGINS
  381. help
  382. This plugin zero-initializes any structures containing a
  383. __user attribute. This can prevent some classes of information
  384. exposures.
  385. This plugin was ported from grsecurity/PaX. More information at:
  386. * https://grsecurity.net/
  387. * https://pax.grsecurity.net/
  388. config GCC_PLUGIN_STRUCTLEAK_BYREF_ALL
  389. bool "Force initialize all struct type variables passed by reference"
  390. depends on GCC_PLUGIN_STRUCTLEAK
  391. help
  392. Zero initialize any struct type local variable that may be passed by
  393. reference without having been initialized.
  394. config GCC_PLUGIN_STRUCTLEAK_VERBOSE
  395. bool "Report forcefully initialized variables"
  396. depends on GCC_PLUGIN_STRUCTLEAK
  397. depends on !COMPILE_TEST
  398. help
  399. This option will cause a warning to be printed each time the
  400. structleak plugin finds a variable it thinks needs to be
  401. initialized. Since not all existing initializers are detected
  402. by the plugin, this can produce false positive warnings.
  403. config GCC_PLUGIN_RANDSTRUCT
  404. bool "Randomize layout of sensitive kernel structures"
  405. depends on GCC_PLUGINS
  406. select MODVERSIONS if MODULES
  407. help
  408. If you say Y here, the layouts of structures that are entirely
  409. function pointers (and have not been manually annotated with
  410. __no_randomize_layout), or structures that have been explicitly
  411. marked with __randomize_layout, will be randomized at compile-time.
  412. This can introduce the requirement of an additional information
  413. exposure vulnerability for exploits targeting these structure
  414. types.
  415. Enabling this feature will introduce some performance impact,
  416. slightly increase memory usage, and prevent the use of forensic
  417. tools like Volatility against the system (unless the kernel
  418. source tree isn't cleaned after kernel installation).
  419. The seed used for compilation is located at
  420. scripts/gcc-plgins/randomize_layout_seed.h. It remains after
  421. a make clean to allow for external modules to be compiled with
  422. the existing seed and will be removed by a make mrproper or
  423. make distclean.
  424. Note that the implementation requires gcc 4.7 or newer.
  425. This plugin was ported from grsecurity/PaX. More information at:
  426. * https://grsecurity.net/
  427. * https://pax.grsecurity.net/
  428. config GCC_PLUGIN_RANDSTRUCT_PERFORMANCE
  429. bool "Use cacheline-aware structure randomization"
  430. depends on GCC_PLUGIN_RANDSTRUCT
  431. depends on !COMPILE_TEST
  432. help
  433. If you say Y here, the RANDSTRUCT randomization will make a
  434. best effort at restricting randomization to cacheline-sized
  435. groups of elements. It will further not randomize bitfields
  436. in structures. This reduces the performance hit of RANDSTRUCT
  437. at the cost of weakened randomization.
  438. config HAVE_CC_STACKPROTECTOR
  439. bool
  440. help
  441. An arch should select this symbol if:
  442. - its compiler supports the -fstack-protector option
  443. - it has implemented a stack canary (e.g. __stack_chk_guard)
  444. config CC_STACKPROTECTOR
  445. def_bool n
  446. help
  447. Set when a stack-protector mode is enabled, so that the build
  448. can enable kernel-side support for the GCC feature.
  449. choice
  450. prompt "Stack Protector buffer overflow detection"
  451. depends on HAVE_CC_STACKPROTECTOR
  452. default CC_STACKPROTECTOR_NONE
  453. help
  454. This option turns on the "stack-protector" GCC feature. This
  455. feature puts, at the beginning of functions, a canary value on
  456. the stack just before the return address, and validates
  457. the value just before actually returning. Stack based buffer
  458. overflows (that need to overwrite this return address) now also
  459. overwrite the canary, which gets detected and the attack is then
  460. neutralized via a kernel panic.
  461. config CC_STACKPROTECTOR_NONE
  462. bool "None"
  463. help
  464. Disable "stack-protector" GCC feature.
  465. config CC_STACKPROTECTOR_REGULAR
  466. bool "Regular"
  467. select CC_STACKPROTECTOR
  468. help
  469. Functions will have the stack-protector canary logic added if they
  470. have an 8-byte or larger character array on the stack.
  471. This feature requires gcc version 4.2 or above, or a distribution
  472. gcc with the feature backported ("-fstack-protector").
  473. On an x86 "defconfig" build, this feature adds canary checks to
  474. about 3% of all kernel functions, which increases kernel code size
  475. by about 0.3%.
  476. config CC_STACKPROTECTOR_STRONG
  477. bool "Strong"
  478. select CC_STACKPROTECTOR
  479. help
  480. Functions will have the stack-protector canary logic added in any
  481. of the following conditions:
  482. - local variable's address used as part of the right hand side of an
  483. assignment or function argument
  484. - local variable is an array (or union containing an array),
  485. regardless of array type or length
  486. - uses register local variables
  487. This feature requires gcc version 4.9 or above, or a distribution
  488. gcc with the feature backported ("-fstack-protector-strong").
  489. On an x86 "defconfig" build, this feature adds canary checks to
  490. about 20% of all kernel functions, which increases the kernel code
  491. size by about 2%.
  492. endchoice
  493. config THIN_ARCHIVES
  494. def_bool y
  495. help
  496. Select this if the architecture wants to use thin archives
  497. instead of ld -r to create the built-in.o files.
  498. choice
  499. prompt "Kernel linker"
  500. default LD_BFD if !LTO_CLANG
  501. default LD_GOLD if LTO_CLANG
  502. help
  503. This selects the linker that will be used to link the kernel and
  504. its composite objects.
  505. Note that using either ld.gold or lld is required for Clang LTO.
  506. ld.bfd will not work.
  507. config LD_BFD
  508. bool "bfd"
  509. depends on !LTO_CLANG
  510. help
  511. Use the standard ld.bfd linker from binutils, which is usually the
  512. default. This linker does not work with Clang LTO.
  513. config LD_GOLD
  514. bool "gold"
  515. depends on LTO_CLANG
  516. help
  517. Use the alternative ld.gold linker from binutils.
  518. config LD_LLD
  519. bool "lld"
  520. help
  521. Use the alternative lld linker from LLVM.
  522. endchoice
  523. config LTO
  524. def_bool n
  525. config ARCH_SUPPORTS_LTO_CLANG
  526. bool
  527. help
  528. An architecture should select this option it supports:
  529. - compiling with clang,
  530. - compiling inline assembly with clang's integrated assembler,
  531. - and linking with either lld or GNU gold w/ LLVMgold.
  532. config ARCH_SUPPORTS_THINLTO
  533. bool
  534. help
  535. An architecture should select this if it supports clang's ThinLTO.
  536. config THINLTO
  537. bool "Use clang ThinLTO (EXPERIMENTAL)"
  538. depends on LTO_CLANG && ARCH_SUPPORTS_THINLTO
  539. default y
  540. help
  541. Use ThinLTO to speed up Link Time Optimization.
  542. choice
  543. prompt "Link-Time Optimization (LTO) (EXPERIMENTAL)"
  544. default LTO_NONE
  545. help
  546. This option turns on Link-Time Optimization (LTO).
  547. config LTO_NONE
  548. bool "None"
  549. config LTO_CLANG
  550. bool "Use clang Link Time Optimization (LTO) (EXPERIMENTAL)"
  551. depends on ARCH_SUPPORTS_LTO_CLANG
  552. depends on !FTRACE_MCOUNT_RECORD || HAVE_C_RECORDMCOUNT
  553. depends on !KASAN
  554. select LTO
  555. select THIN_ARCHIVES
  556. select LD_DEAD_CODE_DATA_ELIMINATION
  557. select LD_GOLD
  558. help
  559. This option enables clang's Link Time Optimization (LTO), which allows
  560. the compiler to optimize the kernel globally at link time. If you
  561. enable this option, the compiler generates LLVM IR instead of object
  562. files, and the actual compilation from IR occurs at the LTO link step,
  563. which may take several minutes.
  564. If you select this option, you must compile the kernel with clang >=
  565. 5.0 (make CC=clang) and GNU gold from binutils >= 2.27, and have the
  566. LLVMgold plug-in in LD_LIBRARY_PATH.
  567. endchoice
  568. config CFI
  569. bool
  570. config CFI_PERMISSIVE
  571. bool "Use CFI in permissive mode"
  572. depends on CFI
  573. help
  574. When selected, Control Flow Integrity (CFI) violations result in a
  575. warning instead of a kernel panic. This option is useful for finding
  576. CFI violations in drivers during development.
  577. config CFI_CLANG
  578. bool "Use clang Control Flow Integrity (CFI) (EXPERIMENTAL)"
  579. depends on LTO_CLANG
  580. depends on KALLSYMS
  581. select CFI
  582. help
  583. This option enables clang Control Flow Integrity (CFI), which adds
  584. runtime checking for indirect function calls.
  585. config CFI_CLANG_SHADOW
  586. bool "Use CFI shadow to speed up cross-module checks"
  587. default y
  588. depends on CFI_CLANG
  589. help
  590. If you select this option, the kernel builds a fast look-up table of
  591. CFI check functions in loaded modules to reduce overhead.
  592. config ARCH_SUPPORTS_SHADOW_CALL_STACK
  593. bool
  594. help
  595. An architecture should select this if it supports Clang's Shadow
  596. Call Stack, has asm/scs.h, and implements runtime support for shadow
  597. stack switching.
  598. choice
  599. prompt "Return-oriented programming (ROP) protection"
  600. default ROP_PROTECTION_NONE
  601. help
  602. This option controls kernel protections against return-oriented
  603. programming (ROP) attacks, which involve overwriting function return
  604. addresses.
  605. config ROP_PROTECTION_NONE
  606. bool "None"
  607. config SHADOW_CALL_STACK
  608. bool "Clang Shadow Call Stack"
  609. depends on ARCH_SUPPORTS_SHADOW_CALL_STACK
  610. help
  611. This option enables Clang's Shadow Call Stack, which uses a
  612. shadow stack to protect function return addresses from being
  613. overwritten by an attacker. More information can be found from
  614. Clang's documentation:
  615. https://clang.llvm.org/docs/ShadowCallStack.html
  616. Note that security guarantees in the kernel differ from the ones
  617. documented for user space. The kernel must store addresses of shadow
  618. stacks used by other tasks and interrupt handlers in memory, which
  619. means an attacker capable reading and writing arbitrary memory may
  620. be able to locate them and hijack control flow by modifying shadow
  621. stacks that are not currently in use.
  622. endchoice
  623. config SHADOW_CALL_STACK_VMAP
  624. bool "Use virtually mapped shadow call stacks"
  625. depends on SHADOW_CALL_STACK
  626. help
  627. Use virtually mapped shadow call stacks. Selecting this option
  628. provides better stack exhaustion protection, but increases per-thread
  629. memory consumption as a full page is allocated for each shadow stack.
  630. config LLVM_POLLY
  631. bool "Enable LLVM's polyhedral loop optimizer (Polly)"
  632. help
  633. This option enables LLVM's polyhedral loop optimizer known as Polly.
  634. Polly is able to optimize various loops throughout the kernel for
  635. maximum cache locality. This requires an LLVM toolchain explicitly
  636. compiled with Polly support.
  637. config HAVE_ARCH_WITHIN_STACK_FRAMES
  638. bool
  639. help
  640. An architecture should select this if it can walk the kernel stack
  641. frames to determine if an object is part of either the arguments
  642. or local variables (i.e. that it excludes saved return addresses,
  643. and similar) by implementing an inline arch_within_stack_frames(),
  644. which is used by CONFIG_HARDENED_USERCOPY.
  645. config HAVE_CONTEXT_TRACKING
  646. bool
  647. help
  648. Provide kernel/user boundaries probes necessary for subsystems
  649. that need it, such as userspace RCU extended quiescent state.
  650. Syscalls need to be wrapped inside user_exit()-user_enter() through
  651. the slow path using TIF_NOHZ flag. Exceptions handlers must be
  652. wrapped as well. Irqs are already protected inside
  653. rcu_irq_enter/rcu_irq_exit() but preemption or signal handling on
  654. irq exit still need to be protected.
  655. config HAVE_VIRT_CPU_ACCOUNTING
  656. bool
  657. config ARCH_HAS_SCALED_CPUTIME
  658. bool
  659. config HAVE_VIRT_CPU_ACCOUNTING_GEN
  660. bool
  661. default y if 64BIT
  662. help
  663. With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit.
  664. Before enabling this option, arch code must be audited
  665. to ensure there are no races in concurrent read/write of
  666. cputime_t. For example, reading/writing 64-bit cputime_t on
  667. some 32-bit arches may require multiple accesses, so proper
  668. locking is needed to protect against concurrent accesses.
  669. config HAVE_IRQ_TIME_ACCOUNTING
  670. bool
  671. help
  672. Archs need to ensure they use a high enough resolution clock to
  673. support irq time accounting and then call enable_sched_clock_irqtime().
  674. config HAVE_ARCH_TRANSPARENT_HUGEPAGE
  675. bool
  676. config HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
  677. bool
  678. config HAVE_ARCH_HUGE_VMAP
  679. bool
  680. config HAVE_ARCH_SOFT_DIRTY
  681. bool
  682. config HAVE_MOD_ARCH_SPECIFIC
  683. bool
  684. help
  685. The arch uses struct mod_arch_specific to store data. Many arches
  686. just need a simple module loader without arch specific data - those
  687. should not enable this.
  688. config MODULES_USE_ELF_RELA
  689. bool
  690. help
  691. Modules only use ELF RELA relocations. Modules with ELF REL
  692. relocations will give an error.
  693. config MODULES_USE_ELF_REL
  694. bool
  695. help
  696. Modules only use ELF REL relocations. Modules with ELF RELA
  697. relocations will give an error.
  698. config HAVE_UNDERSCORE_SYMBOL_PREFIX
  699. bool
  700. help
  701. Some architectures generate an _ in front of C symbols; things like
  702. module loading and assembly files need to know about this.
  703. config HAVE_IRQ_EXIT_ON_IRQ_STACK
  704. bool
  705. help
  706. Architecture doesn't only execute the irq handler on the irq stack
  707. but also irq_exit(). This way we can process softirqs on this irq
  708. stack instead of switching to a new one when we call __do_softirq()
  709. in the end of an hardirq.
  710. This spares a stack switch and improves cache usage on softirq
  711. processing.
  712. config PGTABLE_LEVELS
  713. int
  714. default 2
  715. config ARCH_HAS_ELF_RANDOMIZE
  716. bool
  717. help
  718. An architecture supports choosing randomized locations for
  719. stack, mmap, brk, and ET_DYN. Defined functions:
  720. - arch_mmap_rnd()
  721. - arch_randomize_brk()
  722. config HAVE_ARCH_MMAP_RND_BITS
  723. bool
  724. help
  725. An arch should select this symbol if it supports setting a variable
  726. number of bits for use in establishing the base address for mmap
  727. allocations, has MMU enabled and provides values for both:
  728. - ARCH_MMAP_RND_BITS_MIN
  729. - ARCH_MMAP_RND_BITS_MAX
  730. config HAVE_EXIT_THREAD
  731. bool
  732. help
  733. An architecture implements exit_thread.
  734. config ARCH_MMAP_RND_BITS_MIN
  735. int
  736. config ARCH_MMAP_RND_BITS_MAX
  737. int
  738. config ARCH_MMAP_RND_BITS_DEFAULT
  739. int
  740. config ARCH_MMAP_RND_BITS
  741. int "Number of bits to use for ASLR of mmap base address" if EXPERT
  742. range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
  743. default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
  744. default ARCH_MMAP_RND_BITS_MIN
  745. depends on HAVE_ARCH_MMAP_RND_BITS
  746. help
  747. This value can be used to select the number of bits to use to
  748. determine the random offset to the base address of vma regions
  749. resulting from mmap allocations. This value will be bounded
  750. by the architecture's minimum and maximum supported values.
  751. This value can be changed after boot using the
  752. /proc/sys/vm/mmap_rnd_bits tunable
  753. config HAVE_ARCH_MMAP_RND_COMPAT_BITS
  754. bool
  755. help
  756. An arch should select this symbol if it supports running applications
  757. in compatibility mode, supports setting a variable number of bits for
  758. use in establishing the base address for mmap allocations, has MMU
  759. enabled and provides values for both:
  760. - ARCH_MMAP_RND_COMPAT_BITS_MIN
  761. - ARCH_MMAP_RND_COMPAT_BITS_MAX
  762. config ARCH_MMAP_RND_COMPAT_BITS_MIN
  763. int
  764. config ARCH_MMAP_RND_COMPAT_BITS_MAX
  765. int
  766. config ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
  767. int
  768. config ARCH_MMAP_RND_COMPAT_BITS
  769. int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
  770. range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
  771. default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
  772. default ARCH_MMAP_RND_COMPAT_BITS_MIN
  773. depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
  774. help
  775. This value can be used to select the number of bits to use to
  776. determine the random offset to the base address of vma regions
  777. resulting from mmap allocations for compatible applications This
  778. value will be bounded by the architecture's minimum and maximum
  779. supported values.
  780. This value can be changed after boot using the
  781. /proc/sys/vm/mmap_rnd_compat_bits tunable
  782. config HAVE_ARCH_COMPAT_MMAP_BASES
  783. bool
  784. help
  785. This allows 64bit applications to invoke 32-bit mmap() syscall
  786. and vice-versa 32-bit applications to call 64-bit mmap().
  787. Required for applications doing different bitness syscalls.
  788. config HAVE_COPY_THREAD_TLS
  789. bool
  790. help
  791. Architecture provides copy_thread_tls to accept tls argument via
  792. normal C parameter passing, rather than extracting the syscall
  793. argument from pt_regs.
  794. config HAVE_STACK_VALIDATION
  795. bool
  796. help
  797. Architecture supports the 'objtool check' host tool command, which
  798. performs compile-time stack metadata validation.
  799. config HAVE_RELIABLE_STACKTRACE
  800. bool
  801. help
  802. Architecture has a save_stack_trace_tsk_reliable() function which
  803. only returns a stack trace if it can guarantee the trace is reliable.
  804. config HAVE_ARCH_HASH
  805. bool
  806. default n
  807. help
  808. If this is set, the architecture provides an <asm/hash.h>
  809. file which provides platform-specific implementations of some
  810. functions in <linux/hash.h> or fs/namei.c.
  811. config ISA_BUS_API
  812. def_bool ISA
  813. #
  814. # ABI hall of shame
  815. #
  816. config CLONE_BACKWARDS
  817. bool
  818. help
  819. Architecture has tls passed as the 4th argument of clone(2),
  820. not the 5th one.
  821. config CLONE_BACKWARDS2
  822. bool
  823. help
  824. Architecture has the first two arguments of clone(2) swapped.
  825. config CLONE_BACKWARDS3
  826. bool
  827. help
  828. Architecture has tls passed as the 3rd argument of clone(2),
  829. not the 5th one.
  830. config ODD_RT_SIGACTION
  831. bool
  832. help
  833. Architecture has unusual rt_sigaction(2) arguments
  834. config OLD_SIGSUSPEND
  835. bool
  836. help
  837. Architecture has old sigsuspend(2) syscall, of one-argument variety
  838. config OLD_SIGSUSPEND3
  839. bool
  840. help
  841. Even weirder antique ABI - three-argument sigsuspend(2)
  842. config OLD_SIGACTION
  843. bool
  844. help
  845. Architecture has old sigaction(2) syscall. Nope, not the same
  846. as OLD_SIGSUSPEND | OLD_SIGSUSPEND3 - alpha has sigsuspend(2),
  847. but fairly different variant of sigaction(2), thanks to OSF/1
  848. compatibility...
  849. config COMPAT_OLD_SIGACTION
  850. bool
  851. config ARCH_NO_COHERENT_DMA_MMAP
  852. bool
  853. config CPU_NO_EFFICIENT_FFS
  854. def_bool n
  855. config HAVE_ARCH_VMAP_STACK
  856. def_bool n
  857. help
  858. An arch should select this symbol if it can support kernel stacks
  859. in vmalloc space. This means:
  860. - vmalloc space must be large enough to hold many kernel stacks.
  861. This may rule out many 32-bit architectures.
  862. - Stacks in vmalloc space need to work reliably. For example, if
  863. vmap page tables are created on demand, either this mechanism
  864. needs to work while the stack points to a virtual address with
  865. unpopulated page tables or arch code (switch_to() and switch_mm(),
  866. most likely) needs to ensure that the stack's page table entries
  867. are populated before running on a possibly unpopulated stack.
  868. - If the stack overflows into a guard page, something reasonable
  869. should happen. The definition of "reasonable" is flexible, but
  870. instantly rebooting without logging anything would be unfriendly.
  871. config VMAP_STACK
  872. default y
  873. bool "Use a virtually-mapped stack"
  874. depends on HAVE_ARCH_VMAP_STACK && !KASAN
  875. ---help---
  876. Enable this if you want the use virtually-mapped kernel stacks
  877. with guard pages. This causes kernel stack overflows to be
  878. caught immediately rather than causing difficult-to-diagnose
  879. corruption.
  880. This is presently incompatible with KASAN because KASAN expects
  881. the stack to map directly to the KASAN shadow map using a formula
  882. that is incorrect if the stack is in vmalloc space.
  883. config ARCH_OPTIONAL_KERNEL_RWX
  884. def_bool n
  885. config ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
  886. def_bool n
  887. config ARCH_HAS_STRICT_KERNEL_RWX
  888. def_bool n
  889. config STRICT_KERNEL_RWX
  890. bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX
  891. depends on ARCH_HAS_STRICT_KERNEL_RWX
  892. default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
  893. help
  894. If this is set, kernel text and rodata memory will be made read-only,
  895. and non-text memory will be made non-executable. This provides
  896. protection against certain security exploits (e.g. executing the heap
  897. or modifying text)
  898. These features are considered standard security practice these days.
  899. You should say Y here in almost all cases.
  900. config ARCH_HAS_STRICT_MODULE_RWX
  901. def_bool n
  902. config STRICT_MODULE_RWX
  903. bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX
  904. depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES
  905. default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
  906. help
  907. If this is set, module text and rodata memory will be made read-only,
  908. and non-text memory will be made non-executable. This provides
  909. protection against certain security exploits (e.g. writing to text)
  910. config ARCH_HAS_REFCOUNT
  911. bool
  912. help
  913. An architecture selects this when it has implemented refcount_t
  914. using open coded assembly primitives that provide an optimized
  915. refcount_t implementation, possibly at the expense of some full
  916. refcount state checks of CONFIG_REFCOUNT_FULL=y.
  917. The refcount overflow check behavior, however, must be retained.
  918. Catching overflows is the primary security concern for protecting
  919. against bugs in reference counts.
  920. config REFCOUNT_FULL
  921. bool "Perform full reference count validation at the expense of speed"
  922. help
  923. Enabling this switches the refcounting infrastructure from a fast
  924. unchecked atomic_t implementation to a fully state checked
  925. implementation, which can be (slightly) slower but provides protections
  926. against various use-after-free conditions that can be used in
  927. security flaw exploits.
  928. config HAVE_ARCH_COMPILER_H
  929. bool
  930. help
  931. An architecture can select this if it provides an
  932. asm/compiler.h header that should be included after
  933. linux/compiler-*.h in order to override macro definitions that those
  934. headers generally provide.
  935. # Select if the architecture has support for applying RELR relocations.
  936. config ARCH_HAS_RELR
  937. bool
  938. config RELR
  939. bool "Use RELR relocation packing"
  940. depends on ARCH_HAS_RELR && TOOLS_SUPPORT_RELR
  941. default y
  942. help
  943. Store the kernel's dynamic relocations in the RELR relocation packing
  944. format. Requires a compatible linker (LLD supports this feature), as
  945. well as compatible NM and OBJCOPY utilities (llvm-nm and llvm-objcopy
  946. are compatible).
  947. source "kernel/gcov/Kconfig"