Kconfig 30 KB

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