Kconfig 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974
  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_RSEQ
  226. bool
  227. depends on HAVE_REGS_AND_STACK_ACCESS_API
  228. help
  229. This symbol should be selected by an architecture if it
  230. supports an implementation of restartable sequences.
  231. config HAVE_CLK
  232. bool
  233. help
  234. The <linux/clk.h> calls support software clock gating and
  235. thus are a key power management tool on many systems.
  236. config HAVE_HW_BREAKPOINT
  237. bool
  238. depends on PERF_EVENTS
  239. config HAVE_MIXED_BREAKPOINTS_REGS
  240. bool
  241. depends on HAVE_HW_BREAKPOINT
  242. help
  243. Depending on the arch implementation of hardware breakpoints,
  244. some of them have separate registers for data and instruction
  245. breakpoints addresses, others have mixed registers to store
  246. them but define the access type in a control register.
  247. Select this option if your arch implements breakpoints under the
  248. latter fashion.
  249. config HAVE_USER_RETURN_NOTIFIER
  250. bool
  251. config HAVE_PERF_EVENTS_NMI
  252. bool
  253. help
  254. System hardware can generate an NMI using the perf event
  255. subsystem. Also has support for calculating CPU cycle events
  256. to determine how many clock cycles in a given period.
  257. config HAVE_HARDLOCKUP_DETECTOR_PERF
  258. bool
  259. depends on HAVE_PERF_EVENTS_NMI
  260. help
  261. The arch chooses to use the generic perf-NMI-based hardlockup
  262. detector. Must define HAVE_PERF_EVENTS_NMI.
  263. config HAVE_NMI_WATCHDOG
  264. depends on HAVE_NMI
  265. bool
  266. help
  267. The arch provides a low level NMI watchdog. It provides
  268. asm/nmi.h, and defines its own arch_touch_nmi_watchdog().
  269. config HAVE_HARDLOCKUP_DETECTOR_ARCH
  270. bool
  271. select HAVE_NMI_WATCHDOG
  272. help
  273. The arch chooses to provide its own hardlockup detector, which is
  274. a superset of the HAVE_NMI_WATCHDOG. It also conforms to config
  275. interfaces and parameters provided by hardlockup detector subsystem.
  276. config HAVE_PERF_REGS
  277. bool
  278. help
  279. Support selective register dumps for perf events. This includes
  280. bit-mapping of each registers and a unique architecture id.
  281. config HAVE_PERF_USER_STACK_DUMP
  282. bool
  283. help
  284. Support user stack dumps for perf event samples. This needs
  285. access to the user stack pointer which is not unified across
  286. architectures.
  287. config HAVE_ARCH_JUMP_LABEL
  288. bool
  289. config HAVE_RCU_TABLE_FREE
  290. bool
  291. config ARCH_HAVE_NMI_SAFE_CMPXCHG
  292. bool
  293. config HAVE_ALIGNED_STRUCT_PAGE
  294. bool
  295. help
  296. This makes sure that struct pages are double word aligned and that
  297. e.g. the SLUB allocator can perform double word atomic operations
  298. on a struct page for better performance. However selecting this
  299. might increase the size of a struct page by a word.
  300. config HAVE_CMPXCHG_LOCAL
  301. bool
  302. config HAVE_CMPXCHG_DOUBLE
  303. bool
  304. config ARCH_WEAK_RELEASE_ACQUIRE
  305. bool
  306. config ARCH_WANT_IPC_PARSE_VERSION
  307. bool
  308. config ARCH_WANT_COMPAT_IPC_PARSE_VERSION
  309. bool
  310. config ARCH_WANT_OLD_COMPAT_IPC
  311. select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
  312. bool
  313. config HAVE_ARCH_SECCOMP_FILTER
  314. bool
  315. help
  316. An arch should select this symbol if it provides all of these things:
  317. - syscall_get_arch()
  318. - syscall_get_arguments()
  319. - syscall_rollback()
  320. - syscall_set_return_value()
  321. - SIGSYS siginfo_t support
  322. - secure_computing is called from a ptrace_event()-safe context
  323. - secure_computing return value is checked and a return value of -1
  324. results in the system call being skipped immediately.
  325. - seccomp syscall wired up
  326. config SECCOMP_FILTER
  327. def_bool y
  328. depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
  329. help
  330. Enable tasks to build secure computing environments defined
  331. in terms of Berkeley Packet Filter programs which implement
  332. task-defined system call filtering polices.
  333. See Documentation/userspace-api/seccomp_filter.rst for details.
  334. preferred-plugin-hostcc := $(if-success,[ $(gcc-version) -ge 40800 ],$(HOSTCXX),$(HOSTCC))
  335. config PLUGIN_HOSTCC
  336. string
  337. default "$(shell,$(srctree)/scripts/gcc-plugin.sh "$(preferred-plugin-hostcc)" "$(HOSTCXX)" "$(CC)")"
  338. help
  339. Host compiler used to build GCC plugins. This can be $(HOSTCXX),
  340. $(HOSTCC), or a null string if GCC plugin is unsupported.
  341. config HAVE_GCC_PLUGINS
  342. bool
  343. help
  344. An arch should select this symbol if it supports building with
  345. GCC plugins.
  346. menuconfig GCC_PLUGINS
  347. bool "GCC plugins"
  348. depends on HAVE_GCC_PLUGINS
  349. depends on PLUGIN_HOSTCC != ""
  350. help
  351. GCC plugins are loadable modules that provide extra features to the
  352. compiler. They are useful for runtime instrumentation and static analysis.
  353. See Documentation/gcc-plugins.txt for details.
  354. config GCC_PLUGIN_CYC_COMPLEXITY
  355. bool "Compute the cyclomatic complexity of a function" if EXPERT
  356. depends on GCC_PLUGINS
  357. depends on !COMPILE_TEST # too noisy
  358. help
  359. The complexity M of a function's control flow graph is defined as:
  360. M = E - N + 2P
  361. where
  362. E = the number of edges
  363. N = the number of nodes
  364. P = the number of connected components (exit nodes).
  365. Enabling this plugin reports the complexity to stderr during the
  366. build. It mainly serves as a simple example of how to create a
  367. gcc plugin for the kernel.
  368. config GCC_PLUGIN_SANCOV
  369. bool
  370. depends on GCC_PLUGINS
  371. help
  372. This plugin inserts a __sanitizer_cov_trace_pc() call at the start of
  373. basic blocks. It supports all gcc versions with plugin support (from
  374. gcc-4.5 on). It is based on the commit "Add fuzzing coverage support"
  375. by Dmitry Vyukov <dvyukov@google.com>.
  376. config GCC_PLUGIN_LATENT_ENTROPY
  377. bool "Generate some entropy during boot and runtime"
  378. depends on GCC_PLUGINS
  379. help
  380. By saying Y here the kernel will instrument some kernel code to
  381. extract some entropy from both original and artificially created
  382. program state. This will help especially embedded systems where
  383. there is little 'natural' source of entropy normally. The cost
  384. is some slowdown of the boot process (about 0.5%) and fork and
  385. irq processing.
  386. Note that entropy extracted this way is not cryptographically
  387. secure!
  388. This plugin was ported from grsecurity/PaX. More information at:
  389. * https://grsecurity.net/
  390. * https://pax.grsecurity.net/
  391. config GCC_PLUGIN_STRUCTLEAK
  392. bool "Force initialization of variables containing userspace addresses"
  393. depends on GCC_PLUGINS
  394. # Currently STRUCTLEAK inserts initialization out of live scope of
  395. # variables from KASAN point of view. This leads to KASAN false
  396. # positive reports. Prohibit this combination for now.
  397. depends on !KASAN_EXTRA
  398. help
  399. This plugin zero-initializes any structures containing a
  400. __user attribute. This can prevent some classes of information
  401. exposures.
  402. This plugin was ported from grsecurity/PaX. More information at:
  403. * https://grsecurity.net/
  404. * https://pax.grsecurity.net/
  405. config GCC_PLUGIN_STRUCTLEAK_BYREF_ALL
  406. bool "Force initialize all struct type variables passed by reference"
  407. depends on GCC_PLUGIN_STRUCTLEAK
  408. depends on !COMPILE_TEST
  409. help
  410. Zero initialize any struct type local variable that may be passed by
  411. reference without having been initialized.
  412. config GCC_PLUGIN_STRUCTLEAK_VERBOSE
  413. bool "Report forcefully initialized variables"
  414. depends on GCC_PLUGIN_STRUCTLEAK
  415. depends on !COMPILE_TEST # too noisy
  416. help
  417. This option will cause a warning to be printed each time the
  418. structleak plugin finds a variable it thinks needs to be
  419. initialized. Since not all existing initializers are detected
  420. by the plugin, this can produce false positive warnings.
  421. config GCC_PLUGIN_RANDSTRUCT
  422. bool "Randomize layout of sensitive kernel structures"
  423. depends on GCC_PLUGINS
  424. select MODVERSIONS if MODULES
  425. help
  426. If you say Y here, the layouts of structures that are entirely
  427. function pointers (and have not been manually annotated with
  428. __no_randomize_layout), or structures that have been explicitly
  429. marked with __randomize_layout, will be randomized at compile-time.
  430. This can introduce the requirement of an additional information
  431. exposure vulnerability for exploits targeting these structure
  432. types.
  433. Enabling this feature will introduce some performance impact,
  434. slightly increase memory usage, and prevent the use of forensic
  435. tools like Volatility against the system (unless the kernel
  436. source tree isn't cleaned after kernel installation).
  437. The seed used for compilation is located at
  438. scripts/gcc-plgins/randomize_layout_seed.h. It remains after
  439. a make clean to allow for external modules to be compiled with
  440. the existing seed and will be removed by a make mrproper or
  441. make distclean.
  442. Note that the implementation requires gcc 4.7 or newer.
  443. This plugin was ported from grsecurity/PaX. More information at:
  444. * https://grsecurity.net/
  445. * https://pax.grsecurity.net/
  446. config GCC_PLUGIN_RANDSTRUCT_PERFORMANCE
  447. bool "Use cacheline-aware structure randomization"
  448. depends on GCC_PLUGIN_RANDSTRUCT
  449. depends on !COMPILE_TEST # do not reduce test coverage
  450. help
  451. If you say Y here, the RANDSTRUCT randomization will make a
  452. best effort at restricting randomization to cacheline-sized
  453. groups of elements. It will further not randomize bitfields
  454. in structures. This reduces the performance hit of RANDSTRUCT
  455. at the cost of weakened randomization.
  456. config HAVE_STACKPROTECTOR
  457. bool
  458. help
  459. An arch should select this symbol if:
  460. - it has implemented a stack canary (e.g. __stack_chk_guard)
  461. config CC_HAS_STACKPROTECTOR_NONE
  462. def_bool $(cc-option,-fno-stack-protector)
  463. config STACKPROTECTOR
  464. bool "Stack Protector buffer overflow detection"
  465. depends on HAVE_STACKPROTECTOR
  466. depends on $(cc-option,-fstack-protector)
  467. default y
  468. help
  469. This option turns on the "stack-protector" GCC feature. This
  470. feature puts, at the beginning of functions, a canary value on
  471. the stack just before the return address, and validates
  472. the value just before actually returning. Stack based buffer
  473. overflows (that need to overwrite this return address) now also
  474. overwrite the canary, which gets detected and the attack is then
  475. neutralized via a kernel panic.
  476. Functions will have the stack-protector canary logic added if they
  477. have an 8-byte or larger character array on the stack.
  478. This feature requires gcc version 4.2 or above, or a distribution
  479. gcc with the feature backported ("-fstack-protector").
  480. On an x86 "defconfig" build, this feature adds canary checks to
  481. about 3% of all kernel functions, which increases kernel code size
  482. by about 0.3%.
  483. config STACKPROTECTOR_STRONG
  484. bool "Strong Stack Protector"
  485. depends on STACKPROTECTOR
  486. depends on $(cc-option,-fstack-protector-strong)
  487. default y
  488. help
  489. Functions will have the stack-protector canary logic added in any
  490. of the following conditions:
  491. - local variable's address used as part of the right hand side of an
  492. assignment or function argument
  493. - local variable is an array (or union containing an array),
  494. regardless of array type or length
  495. - uses register local variables
  496. This feature requires gcc version 4.9 or above, or a distribution
  497. gcc with the feature backported ("-fstack-protector-strong").
  498. On an x86 "defconfig" build, this feature adds canary checks to
  499. about 20% of all kernel functions, which increases the kernel code
  500. size by about 2%.
  501. config HAVE_ARCH_WITHIN_STACK_FRAMES
  502. bool
  503. help
  504. An architecture should select this if it can walk the kernel stack
  505. frames to determine if an object is part of either the arguments
  506. or local variables (i.e. that it excludes saved return addresses,
  507. and similar) by implementing an inline arch_within_stack_frames(),
  508. which is used by CONFIG_HARDENED_USERCOPY.
  509. config HAVE_CONTEXT_TRACKING
  510. bool
  511. help
  512. Provide kernel/user boundaries probes necessary for subsystems
  513. that need it, such as userspace RCU extended quiescent state.
  514. Syscalls need to be wrapped inside user_exit()-user_enter() through
  515. the slow path using TIF_NOHZ flag. Exceptions handlers must be
  516. wrapped as well. Irqs are already protected inside
  517. rcu_irq_enter/rcu_irq_exit() but preemption or signal handling on
  518. irq exit still need to be protected.
  519. config HAVE_VIRT_CPU_ACCOUNTING
  520. bool
  521. config ARCH_HAS_SCALED_CPUTIME
  522. bool
  523. config HAVE_VIRT_CPU_ACCOUNTING_GEN
  524. bool
  525. default y if 64BIT
  526. help
  527. With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit.
  528. Before enabling this option, arch code must be audited
  529. to ensure there are no races in concurrent read/write of
  530. cputime_t. For example, reading/writing 64-bit cputime_t on
  531. some 32-bit arches may require multiple accesses, so proper
  532. locking is needed to protect against concurrent accesses.
  533. config HAVE_IRQ_TIME_ACCOUNTING
  534. bool
  535. help
  536. Archs need to ensure they use a high enough resolution clock to
  537. support irq time accounting and then call enable_sched_clock_irqtime().
  538. config HAVE_ARCH_TRANSPARENT_HUGEPAGE
  539. bool
  540. config HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
  541. bool
  542. config HAVE_ARCH_HUGE_VMAP
  543. bool
  544. config HAVE_ARCH_SOFT_DIRTY
  545. bool
  546. config HAVE_MOD_ARCH_SPECIFIC
  547. bool
  548. help
  549. The arch uses struct mod_arch_specific to store data. Many arches
  550. just need a simple module loader without arch specific data - those
  551. should not enable this.
  552. config MODULES_USE_ELF_RELA
  553. bool
  554. help
  555. Modules only use ELF RELA relocations. Modules with ELF REL
  556. relocations will give an error.
  557. config MODULES_USE_ELF_REL
  558. bool
  559. help
  560. Modules only use ELF REL relocations. Modules with ELF RELA
  561. relocations will give an error.
  562. config HAVE_IRQ_EXIT_ON_IRQ_STACK
  563. bool
  564. help
  565. Architecture doesn't only execute the irq handler on the irq stack
  566. but also irq_exit(). This way we can process softirqs on this irq
  567. stack instead of switching to a new one when we call __do_softirq()
  568. in the end of an hardirq.
  569. This spares a stack switch and improves cache usage on softirq
  570. processing.
  571. config PGTABLE_LEVELS
  572. int
  573. default 2
  574. config ARCH_HAS_ELF_RANDOMIZE
  575. bool
  576. help
  577. An architecture supports choosing randomized locations for
  578. stack, mmap, brk, and ET_DYN. Defined functions:
  579. - arch_mmap_rnd()
  580. - arch_randomize_brk()
  581. config HAVE_ARCH_MMAP_RND_BITS
  582. bool
  583. help
  584. An arch should select this symbol if it supports setting a variable
  585. number of bits for use in establishing the base address for mmap
  586. allocations, has MMU enabled and provides values for both:
  587. - ARCH_MMAP_RND_BITS_MIN
  588. - ARCH_MMAP_RND_BITS_MAX
  589. config HAVE_EXIT_THREAD
  590. bool
  591. help
  592. An architecture implements exit_thread.
  593. config ARCH_MMAP_RND_BITS_MIN
  594. int
  595. config ARCH_MMAP_RND_BITS_MAX
  596. int
  597. config ARCH_MMAP_RND_BITS_DEFAULT
  598. int
  599. config ARCH_MMAP_RND_BITS
  600. int "Number of bits to use for ASLR of mmap base address" if EXPERT
  601. range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
  602. default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
  603. default ARCH_MMAP_RND_BITS_MIN
  604. depends on HAVE_ARCH_MMAP_RND_BITS
  605. help
  606. This value can be used to select the number of bits to use to
  607. determine the random offset to the base address of vma regions
  608. resulting from mmap allocations. This value will be bounded
  609. by the architecture's minimum and maximum supported values.
  610. This value can be changed after boot using the
  611. /proc/sys/vm/mmap_rnd_bits tunable
  612. config HAVE_ARCH_MMAP_RND_COMPAT_BITS
  613. bool
  614. help
  615. An arch should select this symbol if it supports running applications
  616. in compatibility mode, supports setting a variable number of bits for
  617. use in establishing the base address for mmap allocations, has MMU
  618. enabled and provides values for both:
  619. - ARCH_MMAP_RND_COMPAT_BITS_MIN
  620. - ARCH_MMAP_RND_COMPAT_BITS_MAX
  621. config ARCH_MMAP_RND_COMPAT_BITS_MIN
  622. int
  623. config ARCH_MMAP_RND_COMPAT_BITS_MAX
  624. int
  625. config ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
  626. int
  627. config ARCH_MMAP_RND_COMPAT_BITS
  628. int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
  629. range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
  630. default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
  631. default ARCH_MMAP_RND_COMPAT_BITS_MIN
  632. depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
  633. help
  634. This value can be used to select the number of bits to use to
  635. determine the random offset to the base address of vma regions
  636. resulting from mmap allocations for compatible applications This
  637. value will be bounded by the architecture's minimum and maximum
  638. supported values.
  639. This value can be changed after boot using the
  640. /proc/sys/vm/mmap_rnd_compat_bits tunable
  641. config HAVE_ARCH_COMPAT_MMAP_BASES
  642. bool
  643. help
  644. This allows 64bit applications to invoke 32-bit mmap() syscall
  645. and vice-versa 32-bit applications to call 64-bit mmap().
  646. Required for applications doing different bitness syscalls.
  647. config HAVE_COPY_THREAD_TLS
  648. bool
  649. help
  650. Architecture provides copy_thread_tls to accept tls argument via
  651. normal C parameter passing, rather than extracting the syscall
  652. argument from pt_regs.
  653. config HAVE_STACK_VALIDATION
  654. bool
  655. help
  656. Architecture supports the 'objtool check' host tool command, which
  657. performs compile-time stack metadata validation.
  658. config HAVE_RELIABLE_STACKTRACE
  659. bool
  660. help
  661. Architecture has a save_stack_trace_tsk_reliable() function which
  662. only returns a stack trace if it can guarantee the trace is reliable.
  663. config HAVE_ARCH_HASH
  664. bool
  665. default n
  666. help
  667. If this is set, the architecture provides an <asm/hash.h>
  668. file which provides platform-specific implementations of some
  669. functions in <linux/hash.h> or fs/namei.c.
  670. config ISA_BUS_API
  671. def_bool ISA
  672. #
  673. # ABI hall of shame
  674. #
  675. config CLONE_BACKWARDS
  676. bool
  677. help
  678. Architecture has tls passed as the 4th argument of clone(2),
  679. not the 5th one.
  680. config CLONE_BACKWARDS2
  681. bool
  682. help
  683. Architecture has the first two arguments of clone(2) swapped.
  684. config CLONE_BACKWARDS3
  685. bool
  686. help
  687. Architecture has tls passed as the 3rd argument of clone(2),
  688. not the 5th one.
  689. config ODD_RT_SIGACTION
  690. bool
  691. help
  692. Architecture has unusual rt_sigaction(2) arguments
  693. config OLD_SIGSUSPEND
  694. bool
  695. help
  696. Architecture has old sigsuspend(2) syscall, of one-argument variety
  697. config OLD_SIGSUSPEND3
  698. bool
  699. help
  700. Even weirder antique ABI - three-argument sigsuspend(2)
  701. config OLD_SIGACTION
  702. bool
  703. help
  704. Architecture has old sigaction(2) syscall. Nope, not the same
  705. as OLD_SIGSUSPEND | OLD_SIGSUSPEND3 - alpha has sigsuspend(2),
  706. but fairly different variant of sigaction(2), thanks to OSF/1
  707. compatibility...
  708. config COMPAT_OLD_SIGACTION
  709. bool
  710. config 64BIT_TIME
  711. def_bool ARCH_HAS_64BIT_TIME
  712. help
  713. This should be selected by all architectures that need to support
  714. new system calls with a 64-bit time_t. This is relevant on all 32-bit
  715. architectures, and 64-bit architectures as part of compat syscall
  716. handling.
  717. config COMPAT_32BIT_TIME
  718. def_bool (!64BIT && 64BIT_TIME) || COMPAT
  719. help
  720. This enables 32 bit time_t support in addition to 64 bit time_t support.
  721. This is relevant on all 32-bit architectures, and 64-bit architectures
  722. as part of compat syscall handling.
  723. config ARCH_NO_COHERENT_DMA_MMAP
  724. bool
  725. config CPU_NO_EFFICIENT_FFS
  726. def_bool n
  727. config HAVE_ARCH_VMAP_STACK
  728. def_bool n
  729. help
  730. An arch should select this symbol if it can support kernel stacks
  731. in vmalloc space. This means:
  732. - vmalloc space must be large enough to hold many kernel stacks.
  733. This may rule out many 32-bit architectures.
  734. - Stacks in vmalloc space need to work reliably. For example, if
  735. vmap page tables are created on demand, either this mechanism
  736. needs to work while the stack points to a virtual address with
  737. unpopulated page tables or arch code (switch_to() and switch_mm(),
  738. most likely) needs to ensure that the stack's page table entries
  739. are populated before running on a possibly unpopulated stack.
  740. - If the stack overflows into a guard page, something reasonable
  741. should happen. The definition of "reasonable" is flexible, but
  742. instantly rebooting without logging anything would be unfriendly.
  743. config VMAP_STACK
  744. default y
  745. bool "Use a virtually-mapped stack"
  746. depends on HAVE_ARCH_VMAP_STACK && !KASAN
  747. ---help---
  748. Enable this if you want the use virtually-mapped kernel stacks
  749. with guard pages. This causes kernel stack overflows to be
  750. caught immediately rather than causing difficult-to-diagnose
  751. corruption.
  752. This is presently incompatible with KASAN because KASAN expects
  753. the stack to map directly to the KASAN shadow map using a formula
  754. that is incorrect if the stack is in vmalloc space.
  755. config ARCH_OPTIONAL_KERNEL_RWX
  756. def_bool n
  757. config ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
  758. def_bool n
  759. config ARCH_HAS_STRICT_KERNEL_RWX
  760. def_bool n
  761. config STRICT_KERNEL_RWX
  762. bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX
  763. depends on ARCH_HAS_STRICT_KERNEL_RWX
  764. default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
  765. help
  766. If this is set, kernel text and rodata memory will be made read-only,
  767. and non-text memory will be made non-executable. This provides
  768. protection against certain security exploits (e.g. executing the heap
  769. or modifying text)
  770. These features are considered standard security practice these days.
  771. You should say Y here in almost all cases.
  772. config ARCH_HAS_STRICT_MODULE_RWX
  773. def_bool n
  774. config STRICT_MODULE_RWX
  775. bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX
  776. depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES
  777. default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
  778. help
  779. If this is set, module text and rodata memory will be made read-only,
  780. and non-text memory will be made non-executable. This provides
  781. protection against certain security exploits (e.g. writing to text)
  782. # select if the architecture provides an asm/dma-direct.h header
  783. config ARCH_HAS_PHYS_TO_DMA
  784. bool
  785. config ARCH_HAS_REFCOUNT
  786. bool
  787. help
  788. An architecture selects this when it has implemented refcount_t
  789. using open coded assembly primitives that provide an optimized
  790. refcount_t implementation, possibly at the expense of some full
  791. refcount state checks of CONFIG_REFCOUNT_FULL=y.
  792. The refcount overflow check behavior, however, must be retained.
  793. Catching overflows is the primary security concern for protecting
  794. against bugs in reference counts.
  795. config REFCOUNT_FULL
  796. bool "Perform full reference count validation at the expense of speed"
  797. help
  798. Enabling this switches the refcounting infrastructure from a fast
  799. unchecked atomic_t implementation to a fully state checked
  800. implementation, which can be (slightly) slower but provides protections
  801. against various use-after-free conditions that can be used in
  802. security flaw exploits.
  803. source "kernel/gcov/Kconfig"