Kconfig 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886
  1. # SPDX-License-Identifier: GPL-2.0
  2. #
  3. # General architecture dependent options
  4. #
  5. #
  6. # Note: arch/$(SRCARCH)/Kconfig needs to be included first so that it can
  7. # override the default values in this file.
  8. #
  9. source "arch/$(SRCARCH)/Kconfig"
  10. menu "General architecture-dependent options"
  11. config CRASH_CORE
  12. bool
  13. config KEXEC_CORE
  14. select CRASH_CORE
  15. bool
  16. config HAVE_IMA_KEXEC
  17. bool
  18. config HOTPLUG_SMT
  19. bool
  20. config OPROFILE
  21. tristate "OProfile system profiling"
  22. depends on PROFILING
  23. depends on HAVE_OPROFILE
  24. select RING_BUFFER
  25. select RING_BUFFER_ALLOW_SWAP
  26. help
  27. OProfile is a profiling system capable of profiling the
  28. whole system, include the kernel, kernel modules, libraries,
  29. and applications.
  30. If unsure, say N.
  31. config OPROFILE_EVENT_MULTIPLEX
  32. bool "OProfile multiplexing support (EXPERIMENTAL)"
  33. default n
  34. depends on OPROFILE && X86
  35. help
  36. The number of hardware counters is limited. The multiplexing
  37. feature enables OProfile to gather more events than counters
  38. are provided by the hardware. This is realized by switching
  39. between events at a user specified time interval.
  40. If unsure, say N.
  41. config HAVE_OPROFILE
  42. bool
  43. config OPROFILE_NMI_TIMER
  44. def_bool y
  45. depends on PERF_EVENTS && HAVE_PERF_EVENTS_NMI && !PPC64
  46. config KPROBES
  47. bool "Kprobes"
  48. depends on MODULES
  49. depends on HAVE_KPROBES
  50. select KALLSYMS
  51. help
  52. Kprobes allows you to trap at almost any kernel address and
  53. execute a callback function. register_kprobe() establishes
  54. a probepoint and specifies the callback. Kprobes is useful
  55. for kernel debugging, non-intrusive instrumentation and testing.
  56. If in doubt, say "N".
  57. config JUMP_LABEL
  58. bool "Optimize very unlikely/likely branches"
  59. depends on HAVE_ARCH_JUMP_LABEL
  60. help
  61. This option enables a transparent branch optimization that
  62. makes certain almost-always-true or almost-always-false branch
  63. conditions even cheaper to execute within the kernel.
  64. Certain performance-sensitive kernel code, such as trace points,
  65. scheduler functionality, networking code and KVM have such
  66. branches and include support for this optimization technique.
  67. If it is detected that the compiler has support for "asm goto",
  68. the kernel will compile such branches with just a nop
  69. instruction. When the condition flag is toggled to true, the
  70. nop will be converted to a jump instruction to execute the
  71. conditional block of instructions.
  72. This technique lowers overhead and stress on the branch prediction
  73. of the processor and generally makes the kernel faster. The update
  74. of the condition is slower, but those are always very rare.
  75. ( On 32-bit x86, the necessary options added to the compiler
  76. flags may increase the size of the kernel slightly. )
  77. config STATIC_KEYS_SELFTEST
  78. bool "Static key selftest"
  79. depends on JUMP_LABEL
  80. help
  81. Boot time self-test of the branch patching code.
  82. config OPTPROBES
  83. def_bool y
  84. depends on KPROBES && HAVE_OPTPROBES
  85. select TASKS_RCU if PREEMPT
  86. config KPROBES_ON_FTRACE
  87. def_bool y
  88. depends on KPROBES && HAVE_KPROBES_ON_FTRACE
  89. depends on DYNAMIC_FTRACE_WITH_REGS
  90. help
  91. If function tracer is enabled and the arch supports full
  92. passing of pt_regs to function tracing, then kprobes can
  93. optimize on top of function tracing.
  94. config UPROBES
  95. def_bool n
  96. depends on ARCH_SUPPORTS_UPROBES
  97. help
  98. Uprobes is the user-space counterpart to kprobes: they
  99. enable instrumentation applications (such as 'perf probe')
  100. to establish unintrusive probes in user-space binaries and
  101. libraries, by executing handler functions when the probes
  102. are hit by user-space applications.
  103. ( These probes come in the form of single-byte breakpoints,
  104. managed by the kernel and kept transparent to the probed
  105. application. )
  106. config HAVE_64BIT_ALIGNED_ACCESS
  107. def_bool 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS
  108. help
  109. Some architectures require 64 bit accesses to be 64 bit
  110. aligned, which also requires structs containing 64 bit values
  111. to be 64 bit aligned too. This includes some 32 bit
  112. architectures which can do 64 bit accesses, as well as 64 bit
  113. architectures without unaligned access.
  114. This symbol should be selected by an architecture if 64 bit
  115. accesses are required to be 64 bit aligned in this way even
  116. though it is not a 64 bit architecture.
  117. See Documentation/unaligned-memory-access.txt for more
  118. information on the topic of unaligned memory accesses.
  119. config HAVE_EFFICIENT_UNALIGNED_ACCESS
  120. bool
  121. help
  122. Some architectures are unable to perform unaligned accesses
  123. without the use of get_unaligned/put_unaligned. Others are
  124. unable to perform such accesses efficiently (e.g. trap on
  125. unaligned access and require fixing it up in the exception
  126. handler.)
  127. This symbol should be selected by an architecture if it can
  128. perform unaligned accesses efficiently to allow different
  129. code paths to be selected for these cases. Some network
  130. drivers, for example, could opt to not fix up alignment
  131. problems with received packets if doing so would not help
  132. much.
  133. See Documentation/unaligned-memory-access.txt for more
  134. information on the topic of unaligned memory accesses.
  135. config ARCH_USE_BUILTIN_BSWAP
  136. bool
  137. help
  138. Modern versions of GCC (since 4.4) have builtin functions
  139. for handling byte-swapping. Using these, instead of the old
  140. inline assembler that the architecture code provides in the
  141. __arch_bswapXX() macros, allows the compiler to see what's
  142. happening and offers more opportunity for optimisation. In
  143. particular, the compiler will be able to combine the byteswap
  144. with a nearby load or store and use load-and-swap or
  145. store-and-swap instructions if the architecture has them. It
  146. should almost *never* result in code which is worse than the
  147. hand-coded assembler in <asm/swab.h>. But just in case it
  148. does, the use of the builtins is optional.
  149. Any architecture with load-and-swap or store-and-swap
  150. instructions should set this. And it shouldn't hurt to set it
  151. on architectures that don't have such instructions.
  152. config KRETPROBES
  153. def_bool y
  154. depends on KPROBES && HAVE_KRETPROBES
  155. config USER_RETURN_NOTIFIER
  156. bool
  157. depends on HAVE_USER_RETURN_NOTIFIER
  158. help
  159. Provide a kernel-internal notification when a cpu is about to
  160. switch to user mode.
  161. config HAVE_IOREMAP_PROT
  162. bool
  163. config HAVE_KPROBES
  164. bool
  165. config HAVE_KRETPROBES
  166. bool
  167. config HAVE_OPTPROBES
  168. bool
  169. config HAVE_KPROBES_ON_FTRACE
  170. bool
  171. config HAVE_FUNCTION_ERROR_INJECTION
  172. bool
  173. config HAVE_NMI
  174. bool
  175. #
  176. # An arch should select this if it provides all these things:
  177. #
  178. # task_pt_regs() in asm/processor.h or asm/ptrace.h
  179. # arch_has_single_step() if there is hardware single-step support
  180. # arch_has_block_step() if there is hardware block-step support
  181. # asm/syscall.h supplying asm-generic/syscall.h interface
  182. # linux/regset.h user_regset interfaces
  183. # CORE_DUMP_USE_REGSET #define'd in linux/elf.h
  184. # TIF_SYSCALL_TRACE calls tracehook_report_syscall_{entry,exit}
  185. # TIF_NOTIFY_RESUME calls tracehook_notify_resume()
  186. # signal delivery calls tracehook_signal_handler()
  187. #
  188. config HAVE_ARCH_TRACEHOOK
  189. bool
  190. config HAVE_DMA_CONTIGUOUS
  191. bool
  192. config GENERIC_SMP_IDLE_THREAD
  193. bool
  194. config GENERIC_IDLE_POLL_SETUP
  195. bool
  196. config ARCH_HAS_FORTIFY_SOURCE
  197. bool
  198. help
  199. An architecture should select this when it can successfully
  200. build and run with CONFIG_FORTIFY_SOURCE.
  201. # Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h
  202. config ARCH_HAS_SET_MEMORY
  203. bool
  204. # Select if arch init_task must go in the __init_task_data section
  205. config ARCH_TASK_STRUCT_ON_STACK
  206. bool
  207. # Select if arch has its private alloc_task_struct() function
  208. config ARCH_TASK_STRUCT_ALLOCATOR
  209. bool
  210. config HAVE_ARCH_THREAD_STRUCT_WHITELIST
  211. bool
  212. depends on !ARCH_TASK_STRUCT_ALLOCATOR
  213. help
  214. An architecture should select this to provide hardened usercopy
  215. knowledge about what region of the thread_struct should be
  216. whitelisted for copying to userspace. Normally this is only the
  217. FPU registers. Specifically, arch_thread_struct_whitelist()
  218. should be implemented. Without this, the entire thread_struct
  219. field in task_struct will be left whitelisted.
  220. # Select if arch has its private alloc_thread_stack() function
  221. config ARCH_THREAD_STACK_ALLOCATOR
  222. bool
  223. # Select if arch wants to size task_struct dynamically via arch_task_struct_size:
  224. config ARCH_WANTS_DYNAMIC_TASK_STRUCT
  225. bool
  226. config HAVE_REGS_AND_STACK_ACCESS_API
  227. bool
  228. help
  229. This symbol should be selected by an architecure if it supports
  230. the API needed to access registers and stack entries from pt_regs,
  231. declared in asm/ptrace.h
  232. For example the kprobes-based event tracer needs this API.
  233. config HAVE_RSEQ
  234. bool
  235. depends on HAVE_REGS_AND_STACK_ACCESS_API
  236. help
  237. This symbol should be selected by an architecture if it
  238. supports an implementation of restartable sequences.
  239. config HAVE_FUNCTION_ARG_ACCESS_API
  240. bool
  241. help
  242. This symbol should be selected by an architecure if it supports
  243. the API needed to access function arguments from pt_regs,
  244. declared in asm/ptrace.h
  245. config HAVE_CLK
  246. bool
  247. help
  248. The <linux/clk.h> calls support software clock gating and
  249. thus are a key power management tool on many systems.
  250. config HAVE_HW_BREAKPOINT
  251. bool
  252. depends on PERF_EVENTS
  253. config HAVE_MIXED_BREAKPOINTS_REGS
  254. bool
  255. depends on HAVE_HW_BREAKPOINT
  256. help
  257. Depending on the arch implementation of hardware breakpoints,
  258. some of them have separate registers for data and instruction
  259. breakpoints addresses, others have mixed registers to store
  260. them but define the access type in a control register.
  261. Select this option if your arch implements breakpoints under the
  262. latter fashion.
  263. config HAVE_USER_RETURN_NOTIFIER
  264. bool
  265. config HAVE_PERF_EVENTS_NMI
  266. bool
  267. help
  268. System hardware can generate an NMI using the perf event
  269. subsystem. Also has support for calculating CPU cycle events
  270. to determine how many clock cycles in a given period.
  271. config HAVE_HARDLOCKUP_DETECTOR_PERF
  272. bool
  273. depends on HAVE_PERF_EVENTS_NMI
  274. help
  275. The arch chooses to use the generic perf-NMI-based hardlockup
  276. detector. Must define HAVE_PERF_EVENTS_NMI.
  277. config HAVE_NMI_WATCHDOG
  278. depends on HAVE_NMI
  279. bool
  280. help
  281. The arch provides a low level NMI watchdog. It provides
  282. asm/nmi.h, and defines its own arch_touch_nmi_watchdog().
  283. config HAVE_HARDLOCKUP_DETECTOR_ARCH
  284. bool
  285. select HAVE_NMI_WATCHDOG
  286. help
  287. The arch chooses to provide its own hardlockup detector, which is
  288. a superset of the HAVE_NMI_WATCHDOG. It also conforms to config
  289. interfaces and parameters provided by hardlockup detector subsystem.
  290. config HAVE_PERF_REGS
  291. bool
  292. help
  293. Support selective register dumps for perf events. This includes
  294. bit-mapping of each registers and a unique architecture id.
  295. config HAVE_PERF_USER_STACK_DUMP
  296. bool
  297. help
  298. Support user stack dumps for perf event samples. This needs
  299. access to the user stack pointer which is not unified across
  300. architectures.
  301. config HAVE_ARCH_JUMP_LABEL
  302. bool
  303. config HAVE_ARCH_JUMP_LABEL_RELATIVE
  304. bool
  305. config HAVE_RCU_TABLE_FREE
  306. bool
  307. config HAVE_RCU_TABLE_INVALIDATE
  308. bool
  309. config ARCH_HAVE_NMI_SAFE_CMPXCHG
  310. bool
  311. config HAVE_ALIGNED_STRUCT_PAGE
  312. bool
  313. help
  314. This makes sure that struct pages are double word aligned and that
  315. e.g. the SLUB allocator can perform double word atomic operations
  316. on a struct page for better performance. However selecting this
  317. might increase the size of a struct page by a word.
  318. config HAVE_CMPXCHG_LOCAL
  319. bool
  320. config HAVE_CMPXCHG_DOUBLE
  321. bool
  322. config ARCH_WEAK_RELEASE_ACQUIRE
  323. bool
  324. config ARCH_WANT_IPC_PARSE_VERSION
  325. bool
  326. config ARCH_WANT_COMPAT_IPC_PARSE_VERSION
  327. bool
  328. config ARCH_WANT_OLD_COMPAT_IPC
  329. select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
  330. bool
  331. config HAVE_ARCH_SECCOMP_FILTER
  332. bool
  333. help
  334. An arch should select this symbol if it provides all of these things:
  335. - syscall_get_arch()
  336. - syscall_get_arguments()
  337. - syscall_rollback()
  338. - syscall_set_return_value()
  339. - SIGSYS siginfo_t support
  340. - secure_computing is called from a ptrace_event()-safe context
  341. - secure_computing return value is checked and a return value of -1
  342. results in the system call being skipped immediately.
  343. - seccomp syscall wired up
  344. config SECCOMP_FILTER
  345. def_bool y
  346. depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
  347. help
  348. Enable tasks to build secure computing environments defined
  349. in terms of Berkeley Packet Filter programs which implement
  350. task-defined system call filtering polices.
  351. See Documentation/userspace-api/seccomp_filter.rst for details.
  352. config HAVE_ARCH_STACKLEAK
  353. bool
  354. help
  355. An architecture should select this if it has the code which
  356. fills the used part of the kernel stack with the STACKLEAK_POISON
  357. value before returning from system calls.
  358. config HAVE_STACKPROTECTOR
  359. bool
  360. help
  361. An arch should select this symbol if:
  362. - it has implemented a stack canary (e.g. __stack_chk_guard)
  363. config CC_HAS_STACKPROTECTOR_NONE
  364. def_bool $(cc-option,-fno-stack-protector)
  365. config STACKPROTECTOR
  366. bool "Stack Protector buffer overflow detection"
  367. depends on HAVE_STACKPROTECTOR
  368. depends on $(cc-option,-fstack-protector)
  369. default y
  370. help
  371. This option turns on the "stack-protector" GCC feature. This
  372. feature puts, at the beginning of functions, a canary value on
  373. the stack just before the return address, and validates
  374. the value just before actually returning. Stack based buffer
  375. overflows (that need to overwrite this return address) now also
  376. overwrite the canary, which gets detected and the attack is then
  377. neutralized via a kernel panic.
  378. Functions will have the stack-protector canary logic added if they
  379. have an 8-byte or larger character array on the stack.
  380. This feature requires gcc version 4.2 or above, or a distribution
  381. gcc with the feature backported ("-fstack-protector").
  382. On an x86 "defconfig" build, this feature adds canary checks to
  383. about 3% of all kernel functions, which increases kernel code size
  384. by about 0.3%.
  385. config STACKPROTECTOR_STRONG
  386. bool "Strong Stack Protector"
  387. depends on STACKPROTECTOR
  388. depends on $(cc-option,-fstack-protector-strong)
  389. default y
  390. help
  391. Functions will have the stack-protector canary logic added in any
  392. of the following conditions:
  393. - local variable's address used as part of the right hand side of an
  394. assignment or function argument
  395. - local variable is an array (or union containing an array),
  396. regardless of array type or length
  397. - uses register local variables
  398. This feature requires gcc version 4.9 or above, or a distribution
  399. gcc with the feature backported ("-fstack-protector-strong").
  400. On an x86 "defconfig" build, this feature adds canary checks to
  401. about 20% of all kernel functions, which increases the kernel code
  402. size by about 2%.
  403. config HAVE_ARCH_WITHIN_STACK_FRAMES
  404. bool
  405. help
  406. An architecture should select this if it can walk the kernel stack
  407. frames to determine if an object is part of either the arguments
  408. or local variables (i.e. that it excludes saved return addresses,
  409. and similar) by implementing an inline arch_within_stack_frames(),
  410. which is used by CONFIG_HARDENED_USERCOPY.
  411. config HAVE_CONTEXT_TRACKING
  412. bool
  413. help
  414. Provide kernel/user boundaries probes necessary for subsystems
  415. that need it, such as userspace RCU extended quiescent state.
  416. Syscalls need to be wrapped inside user_exit()-user_enter() through
  417. the slow path using TIF_NOHZ flag. Exceptions handlers must be
  418. wrapped as well. Irqs are already protected inside
  419. rcu_irq_enter/rcu_irq_exit() but preemption or signal handling on
  420. irq exit still need to be protected.
  421. config HAVE_VIRT_CPU_ACCOUNTING
  422. bool
  423. config ARCH_HAS_SCALED_CPUTIME
  424. bool
  425. config HAVE_VIRT_CPU_ACCOUNTING_GEN
  426. bool
  427. default y if 64BIT
  428. help
  429. With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit.
  430. Before enabling this option, arch code must be audited
  431. to ensure there are no races in concurrent read/write of
  432. cputime_t. For example, reading/writing 64-bit cputime_t on
  433. some 32-bit arches may require multiple accesses, so proper
  434. locking is needed to protect against concurrent accesses.
  435. config HAVE_IRQ_TIME_ACCOUNTING
  436. bool
  437. help
  438. Archs need to ensure they use a high enough resolution clock to
  439. support irq time accounting and then call enable_sched_clock_irqtime().
  440. config HAVE_ARCH_TRANSPARENT_HUGEPAGE
  441. bool
  442. config HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
  443. bool
  444. config HAVE_ARCH_HUGE_VMAP
  445. bool
  446. config HAVE_ARCH_SOFT_DIRTY
  447. bool
  448. config HAVE_MOD_ARCH_SPECIFIC
  449. bool
  450. help
  451. The arch uses struct mod_arch_specific to store data. Many arches
  452. just need a simple module loader without arch specific data - those
  453. should not enable this.
  454. config MODULES_USE_ELF_RELA
  455. bool
  456. help
  457. Modules only use ELF RELA relocations. Modules with ELF REL
  458. relocations will give an error.
  459. config MODULES_USE_ELF_REL
  460. bool
  461. help
  462. Modules only use ELF REL relocations. Modules with ELF RELA
  463. relocations will give an error.
  464. config HAVE_IRQ_EXIT_ON_IRQ_STACK
  465. bool
  466. help
  467. Architecture doesn't only execute the irq handler on the irq stack
  468. but also irq_exit(). This way we can process softirqs on this irq
  469. stack instead of switching to a new one when we call __do_softirq()
  470. in the end of an hardirq.
  471. This spares a stack switch and improves cache usage on softirq
  472. processing.
  473. config PGTABLE_LEVELS
  474. int
  475. default 2
  476. config ARCH_HAS_ELF_RANDOMIZE
  477. bool
  478. help
  479. An architecture supports choosing randomized locations for
  480. stack, mmap, brk, and ET_DYN. Defined functions:
  481. - arch_mmap_rnd()
  482. - arch_randomize_brk()
  483. config HAVE_ARCH_MMAP_RND_BITS
  484. bool
  485. help
  486. An arch should select this symbol if it supports setting a variable
  487. number of bits for use in establishing the base address for mmap
  488. allocations, has MMU enabled and provides values for both:
  489. - ARCH_MMAP_RND_BITS_MIN
  490. - ARCH_MMAP_RND_BITS_MAX
  491. config HAVE_EXIT_THREAD
  492. bool
  493. help
  494. An architecture implements exit_thread.
  495. config ARCH_MMAP_RND_BITS_MIN
  496. int
  497. config ARCH_MMAP_RND_BITS_MAX
  498. int
  499. config ARCH_MMAP_RND_BITS_DEFAULT
  500. int
  501. config ARCH_MMAP_RND_BITS
  502. int "Number of bits to use for ASLR of mmap base address" if EXPERT
  503. range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
  504. default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
  505. default ARCH_MMAP_RND_BITS_MIN
  506. depends on HAVE_ARCH_MMAP_RND_BITS
  507. help
  508. This value can be used to select the number of bits to use to
  509. determine the random offset to the base address of vma regions
  510. resulting from mmap allocations. This value will be bounded
  511. by the architecture's minimum and maximum supported values.
  512. This value can be changed after boot using the
  513. /proc/sys/vm/mmap_rnd_bits tunable
  514. config HAVE_ARCH_MMAP_RND_COMPAT_BITS
  515. bool
  516. help
  517. An arch should select this symbol if it supports running applications
  518. in compatibility mode, supports setting a variable number of bits for
  519. use in establishing the base address for mmap allocations, has MMU
  520. enabled and provides values for both:
  521. - ARCH_MMAP_RND_COMPAT_BITS_MIN
  522. - ARCH_MMAP_RND_COMPAT_BITS_MAX
  523. config ARCH_MMAP_RND_COMPAT_BITS_MIN
  524. int
  525. config ARCH_MMAP_RND_COMPAT_BITS_MAX
  526. int
  527. config ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
  528. int
  529. config ARCH_MMAP_RND_COMPAT_BITS
  530. int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
  531. range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
  532. default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
  533. default ARCH_MMAP_RND_COMPAT_BITS_MIN
  534. depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
  535. help
  536. This value can be used to select the number of bits to use to
  537. determine the random offset to the base address of vma regions
  538. resulting from mmap allocations for compatible applications This
  539. value will be bounded by the architecture's minimum and maximum
  540. supported values.
  541. This value can be changed after boot using the
  542. /proc/sys/vm/mmap_rnd_compat_bits tunable
  543. config HAVE_ARCH_COMPAT_MMAP_BASES
  544. bool
  545. help
  546. This allows 64bit applications to invoke 32-bit mmap() syscall
  547. and vice-versa 32-bit applications to call 64-bit mmap().
  548. Required for applications doing different bitness syscalls.
  549. config HAVE_COPY_THREAD_TLS
  550. bool
  551. help
  552. Architecture provides copy_thread_tls to accept tls argument via
  553. normal C parameter passing, rather than extracting the syscall
  554. argument from pt_regs.
  555. config HAVE_STACK_VALIDATION
  556. bool
  557. help
  558. Architecture supports the 'objtool check' host tool command, which
  559. performs compile-time stack metadata validation.
  560. config HAVE_RELIABLE_STACKTRACE
  561. bool
  562. help
  563. Architecture has a save_stack_trace_tsk_reliable() function which
  564. only returns a stack trace if it can guarantee the trace is reliable.
  565. config HAVE_ARCH_HASH
  566. bool
  567. default n
  568. help
  569. If this is set, the architecture provides an <asm/hash.h>
  570. file which provides platform-specific implementations of some
  571. functions in <linux/hash.h> or fs/namei.c.
  572. config ISA_BUS_API
  573. def_bool ISA
  574. #
  575. # ABI hall of shame
  576. #
  577. config CLONE_BACKWARDS
  578. bool
  579. help
  580. Architecture has tls passed as the 4th argument of clone(2),
  581. not the 5th one.
  582. config CLONE_BACKWARDS2
  583. bool
  584. help
  585. Architecture has the first two arguments of clone(2) swapped.
  586. config CLONE_BACKWARDS3
  587. bool
  588. help
  589. Architecture has tls passed as the 3rd argument of clone(2),
  590. not the 5th one.
  591. config ODD_RT_SIGACTION
  592. bool
  593. help
  594. Architecture has unusual rt_sigaction(2) arguments
  595. config OLD_SIGSUSPEND
  596. bool
  597. help
  598. Architecture has old sigsuspend(2) syscall, of one-argument variety
  599. config OLD_SIGSUSPEND3
  600. bool
  601. help
  602. Even weirder antique ABI - three-argument sigsuspend(2)
  603. config OLD_SIGACTION
  604. bool
  605. help
  606. Architecture has old sigaction(2) syscall. Nope, not the same
  607. as OLD_SIGSUSPEND | OLD_SIGSUSPEND3 - alpha has sigsuspend(2),
  608. but fairly different variant of sigaction(2), thanks to OSF/1
  609. compatibility...
  610. config COMPAT_OLD_SIGACTION
  611. bool
  612. config 64BIT_TIME
  613. def_bool ARCH_HAS_64BIT_TIME
  614. help
  615. This should be selected by all architectures that need to support
  616. new system calls with a 64-bit time_t. This is relevant on all 32-bit
  617. architectures, and 64-bit architectures as part of compat syscall
  618. handling.
  619. config COMPAT_32BIT_TIME
  620. def_bool (!64BIT && 64BIT_TIME) || COMPAT
  621. help
  622. This enables 32 bit time_t support in addition to 64 bit time_t support.
  623. This is relevant on all 32-bit architectures, and 64-bit architectures
  624. as part of compat syscall handling.
  625. config ARCH_NO_COHERENT_DMA_MMAP
  626. bool
  627. config ARCH_NO_PREEMPT
  628. bool
  629. config CPU_NO_EFFICIENT_FFS
  630. def_bool n
  631. config HAVE_ARCH_VMAP_STACK
  632. def_bool n
  633. help
  634. An arch should select this symbol if it can support kernel stacks
  635. in vmalloc space. This means:
  636. - vmalloc space must be large enough to hold many kernel stacks.
  637. This may rule out many 32-bit architectures.
  638. - Stacks in vmalloc space need to work reliably. For example, if
  639. vmap page tables are created on demand, either this mechanism
  640. needs to work while the stack points to a virtual address with
  641. unpopulated page tables or arch code (switch_to() and switch_mm(),
  642. most likely) needs to ensure that the stack's page table entries
  643. are populated before running on a possibly unpopulated stack.
  644. - If the stack overflows into a guard page, something reasonable
  645. should happen. The definition of "reasonable" is flexible, but
  646. instantly rebooting without logging anything would be unfriendly.
  647. config VMAP_STACK
  648. default y
  649. bool "Use a virtually-mapped stack"
  650. depends on HAVE_ARCH_VMAP_STACK && !KASAN
  651. ---help---
  652. Enable this if you want the use virtually-mapped kernel stacks
  653. with guard pages. This causes kernel stack overflows to be
  654. caught immediately rather than causing difficult-to-diagnose
  655. corruption.
  656. This is presently incompatible with KASAN because KASAN expects
  657. the stack to map directly to the KASAN shadow map using a formula
  658. that is incorrect if the stack is in vmalloc space.
  659. config ARCH_OPTIONAL_KERNEL_RWX
  660. def_bool n
  661. config ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
  662. def_bool n
  663. config ARCH_HAS_STRICT_KERNEL_RWX
  664. def_bool n
  665. config STRICT_KERNEL_RWX
  666. bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX
  667. depends on ARCH_HAS_STRICT_KERNEL_RWX
  668. default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
  669. help
  670. If this is set, kernel text and rodata memory will be made read-only,
  671. and non-text memory will be made non-executable. This provides
  672. protection against certain security exploits (e.g. executing the heap
  673. or modifying text)
  674. These features are considered standard security practice these days.
  675. You should say Y here in almost all cases.
  676. config ARCH_HAS_STRICT_MODULE_RWX
  677. def_bool n
  678. config STRICT_MODULE_RWX
  679. bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX
  680. depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES
  681. default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
  682. help
  683. If this is set, module text and rodata memory will be made read-only,
  684. and non-text memory will be made non-executable. This provides
  685. protection against certain security exploits (e.g. writing to text)
  686. # select if the architecture provides an asm/dma-direct.h header
  687. config ARCH_HAS_PHYS_TO_DMA
  688. bool
  689. config ARCH_HAS_REFCOUNT
  690. bool
  691. help
  692. An architecture selects this when it has implemented refcount_t
  693. using open coded assembly primitives that provide an optimized
  694. refcount_t implementation, possibly at the expense of some full
  695. refcount state checks of CONFIG_REFCOUNT_FULL=y.
  696. The refcount overflow check behavior, however, must be retained.
  697. Catching overflows is the primary security concern for protecting
  698. against bugs in reference counts.
  699. config REFCOUNT_FULL
  700. bool "Perform full reference count validation at the expense of speed"
  701. help
  702. Enabling this switches the refcounting infrastructure from a fast
  703. unchecked atomic_t implementation to a fully state checked
  704. implementation, which can be (slightly) slower but provides protections
  705. against various use-after-free conditions that can be used in
  706. security flaw exploits.
  707. config HAVE_ARCH_COMPILER_H
  708. bool
  709. help
  710. An architecture can select this if it provides an
  711. asm/compiler.h header that should be included after
  712. linux/compiler-*.h in order to override macro definitions that those
  713. headers generally provide.
  714. config HAVE_ARCH_PREL32_RELOCATIONS
  715. bool
  716. help
  717. May be selected by an architecture if it supports place-relative
  718. 32-bit relocations, both in the toolchain and in the module loader,
  719. in which case relative references can be used in special sections
  720. for PCI fixup, initcalls etc which are only half the size on 64 bit
  721. architectures, and don't require runtime relocation on relocatable
  722. kernels.
  723. source "kernel/gcov/Kconfig"
  724. source "scripts/gcc-plugins/Kconfig"
  725. endmenu