Kconfig 43 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444
  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 KEXEC_ELF
  17. bool
  18. config HAVE_IMA_KEXEC
  19. bool
  20. config ARCH_HAS_SUBPAGE_FAULTS
  21. bool
  22. help
  23. Select if the architecture can check permissions at sub-page
  24. granularity (e.g. arm64 MTE). The probe_user_*() functions
  25. must be implemented.
  26. config HOTPLUG_SMT
  27. bool
  28. config GENERIC_ENTRY
  29. bool
  30. config KPROBES
  31. bool "Kprobes"
  32. depends on MODULES
  33. depends on HAVE_KPROBES
  34. select KALLSYMS
  35. select TASKS_RCU if PREEMPTION
  36. help
  37. Kprobes allows you to trap at almost any kernel address and
  38. execute a callback function. register_kprobe() establishes
  39. a probepoint and specifies the callback. Kprobes is useful
  40. for kernel debugging, non-intrusive instrumentation and testing.
  41. If in doubt, say "N".
  42. config JUMP_LABEL
  43. bool "Optimize very unlikely/likely branches"
  44. depends on HAVE_ARCH_JUMP_LABEL
  45. select OBJTOOL if HAVE_JUMP_LABEL_HACK
  46. help
  47. This option enables a transparent branch optimization that
  48. makes certain almost-always-true or almost-always-false branch
  49. conditions even cheaper to execute within the kernel.
  50. Certain performance-sensitive kernel code, such as trace points,
  51. scheduler functionality, networking code and KVM have such
  52. branches and include support for this optimization technique.
  53. If it is detected that the compiler has support for "asm goto",
  54. the kernel will compile such branches with just a nop
  55. instruction. When the condition flag is toggled to true, the
  56. nop will be converted to a jump instruction to execute the
  57. conditional block of instructions.
  58. This technique lowers overhead and stress on the branch prediction
  59. of the processor and generally makes the kernel faster. The update
  60. of the condition is slower, but those are always very rare.
  61. ( On 32-bit x86, the necessary options added to the compiler
  62. flags may increase the size of the kernel slightly. )
  63. config STATIC_KEYS_SELFTEST
  64. bool "Static key selftest"
  65. depends on JUMP_LABEL
  66. help
  67. Boot time self-test of the branch patching code.
  68. config STATIC_CALL_SELFTEST
  69. bool "Static call selftest"
  70. depends on HAVE_STATIC_CALL
  71. help
  72. Boot time self-test of the call patching code.
  73. config OPTPROBES
  74. def_bool y
  75. depends on KPROBES && HAVE_OPTPROBES
  76. select TASKS_RCU if PREEMPTION
  77. config KPROBES_ON_FTRACE
  78. def_bool y
  79. depends on KPROBES && HAVE_KPROBES_ON_FTRACE
  80. depends on DYNAMIC_FTRACE_WITH_REGS
  81. help
  82. If function tracer is enabled and the arch supports full
  83. passing of pt_regs to function tracing, then kprobes can
  84. optimize on top of function tracing.
  85. config UPROBES
  86. def_bool n
  87. depends on ARCH_SUPPORTS_UPROBES
  88. help
  89. Uprobes is the user-space counterpart to kprobes: they
  90. enable instrumentation applications (such as 'perf probe')
  91. to establish unintrusive probes in user-space binaries and
  92. libraries, by executing handler functions when the probes
  93. are hit by user-space applications.
  94. ( These probes come in the form of single-byte breakpoints,
  95. managed by the kernel and kept transparent to the probed
  96. application. )
  97. config HAVE_64BIT_ALIGNED_ACCESS
  98. def_bool 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS
  99. help
  100. Some architectures require 64 bit accesses to be 64 bit
  101. aligned, which also requires structs containing 64 bit values
  102. to be 64 bit aligned too. This includes some 32 bit
  103. architectures which can do 64 bit accesses, as well as 64 bit
  104. architectures without unaligned access.
  105. This symbol should be selected by an architecture if 64 bit
  106. accesses are required to be 64 bit aligned in this way even
  107. though it is not a 64 bit architecture.
  108. See Documentation/core-api/unaligned-memory-access.rst for
  109. more information on the topic of unaligned memory accesses.
  110. config HAVE_EFFICIENT_UNALIGNED_ACCESS
  111. bool
  112. help
  113. Some architectures are unable to perform unaligned accesses
  114. without the use of get_unaligned/put_unaligned. Others are
  115. unable to perform such accesses efficiently (e.g. trap on
  116. unaligned access and require fixing it up in the exception
  117. handler.)
  118. This symbol should be selected by an architecture if it can
  119. perform unaligned accesses efficiently to allow different
  120. code paths to be selected for these cases. Some network
  121. drivers, for example, could opt to not fix up alignment
  122. problems with received packets if doing so would not help
  123. much.
  124. See Documentation/core-api/unaligned-memory-access.rst for more
  125. information on the topic of unaligned memory accesses.
  126. config ARCH_USE_BUILTIN_BSWAP
  127. bool
  128. help
  129. Modern versions of GCC (since 4.4) have builtin functions
  130. for handling byte-swapping. Using these, instead of the old
  131. inline assembler that the architecture code provides in the
  132. __arch_bswapXX() macros, allows the compiler to see what's
  133. happening and offers more opportunity for optimisation. In
  134. particular, the compiler will be able to combine the byteswap
  135. with a nearby load or store and use load-and-swap or
  136. store-and-swap instructions if the architecture has them. It
  137. should almost *never* result in code which is worse than the
  138. hand-coded assembler in <asm/swab.h>. But just in case it
  139. does, the use of the builtins is optional.
  140. Any architecture with load-and-swap or store-and-swap
  141. instructions should set this. And it shouldn't hurt to set it
  142. on architectures that don't have such instructions.
  143. config KRETPROBES
  144. def_bool y
  145. depends on KPROBES && (HAVE_KRETPROBES || HAVE_RETHOOK)
  146. config KRETPROBE_ON_RETHOOK
  147. def_bool y
  148. depends on HAVE_RETHOOK
  149. depends on KRETPROBES
  150. select RETHOOK
  151. config USER_RETURN_NOTIFIER
  152. bool
  153. depends on HAVE_USER_RETURN_NOTIFIER
  154. help
  155. Provide a kernel-internal notification when a cpu is about to
  156. switch to user mode.
  157. config HAVE_IOREMAP_PROT
  158. bool
  159. config HAVE_KPROBES
  160. bool
  161. config HAVE_KRETPROBES
  162. bool
  163. config HAVE_OPTPROBES
  164. bool
  165. config HAVE_KPROBES_ON_FTRACE
  166. bool
  167. config ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
  168. bool
  169. help
  170. Since kretprobes modifies return address on the stack, the
  171. stacktrace may see the kretprobe trampoline address instead
  172. of correct one. If the architecture stacktrace code and
  173. unwinder can adjust such entries, select this configuration.
  174. config HAVE_FUNCTION_ERROR_INJECTION
  175. bool
  176. config HAVE_NMI
  177. bool
  178. config HAVE_FUNCTION_DESCRIPTORS
  179. bool
  180. config TRACE_IRQFLAGS_SUPPORT
  181. bool
  182. config TRACE_IRQFLAGS_NMI_SUPPORT
  183. bool
  184. #
  185. # An arch should select this if it provides all these things:
  186. #
  187. # task_pt_regs() in asm/processor.h or asm/ptrace.h
  188. # arch_has_single_step() if there is hardware single-step support
  189. # arch_has_block_step() if there is hardware block-step support
  190. # asm/syscall.h supplying asm-generic/syscall.h interface
  191. # linux/regset.h user_regset interfaces
  192. # CORE_DUMP_USE_REGSET #define'd in linux/elf.h
  193. # TIF_SYSCALL_TRACE calls ptrace_report_syscall_{entry,exit}
  194. # TIF_NOTIFY_RESUME calls resume_user_mode_work()
  195. #
  196. config HAVE_ARCH_TRACEHOOK
  197. bool
  198. config HAVE_DMA_CONTIGUOUS
  199. bool
  200. config GENERIC_SMP_IDLE_THREAD
  201. bool
  202. config GENERIC_IDLE_POLL_SETUP
  203. bool
  204. config ARCH_HAS_FORTIFY_SOURCE
  205. bool
  206. help
  207. An architecture should select this when it can successfully
  208. build and run with CONFIG_FORTIFY_SOURCE.
  209. #
  210. # Select if the arch provides a historic keepinit alias for the retain_initrd
  211. # command line option
  212. #
  213. config ARCH_HAS_KEEPINITRD
  214. bool
  215. # Select if arch has all set_memory_ro/rw/x/nx() functions in asm/cacheflush.h
  216. config ARCH_HAS_SET_MEMORY
  217. bool
  218. # Select if arch has all set_direct_map_invalid/default() functions
  219. config ARCH_HAS_SET_DIRECT_MAP
  220. bool
  221. #
  222. # Select if the architecture provides the arch_dma_set_uncached symbol to
  223. # either provide an uncached segment alias for a DMA allocation, or
  224. # to remap the page tables in place.
  225. #
  226. config ARCH_HAS_DMA_SET_UNCACHED
  227. bool
  228. #
  229. # Select if the architectures provides the arch_dma_clear_uncached symbol
  230. # to undo an in-place page table remap for uncached access.
  231. #
  232. config ARCH_HAS_DMA_CLEAR_UNCACHED
  233. bool
  234. config ARCH_HAS_CPU_FINALIZE_INIT
  235. bool
  236. # Select if arch init_task must go in the __init_task_data section
  237. config ARCH_TASK_STRUCT_ON_STACK
  238. bool
  239. # Select if arch has its private alloc_task_struct() function
  240. config ARCH_TASK_STRUCT_ALLOCATOR
  241. bool
  242. config HAVE_ARCH_THREAD_STRUCT_WHITELIST
  243. bool
  244. depends on !ARCH_TASK_STRUCT_ALLOCATOR
  245. help
  246. An architecture should select this to provide hardened usercopy
  247. knowledge about what region of the thread_struct should be
  248. whitelisted for copying to userspace. Normally this is only the
  249. FPU registers. Specifically, arch_thread_struct_whitelist()
  250. should be implemented. Without this, the entire thread_struct
  251. field in task_struct will be left whitelisted.
  252. # Select if arch has its private alloc_thread_stack() function
  253. config ARCH_THREAD_STACK_ALLOCATOR
  254. bool
  255. # Select if arch wants to size task_struct dynamically via arch_task_struct_size:
  256. config ARCH_WANTS_DYNAMIC_TASK_STRUCT
  257. bool
  258. config ARCH_WANTS_NO_INSTR
  259. bool
  260. help
  261. An architecture should select this if the noinstr macro is being used on
  262. functions to denote that the toolchain should avoid instrumenting such
  263. functions and is required for correctness.
  264. config ARCH_32BIT_OFF_T
  265. bool
  266. depends on !64BIT
  267. help
  268. All new 32-bit architectures should have 64-bit off_t type on
  269. userspace side which corresponds to the loff_t kernel type. This
  270. is the requirement for modern ABIs. Some existing architectures
  271. still support 32-bit off_t. This option is enabled for all such
  272. architectures explicitly.
  273. # Selected by 64 bit architectures which have a 32 bit f_tinode in struct ustat
  274. config ARCH_32BIT_USTAT_F_TINODE
  275. bool
  276. config HAVE_ASM_MODVERSIONS
  277. bool
  278. help
  279. This symbol should be selected by an architecture if it provides
  280. <asm/asm-prototypes.h> to support the module versioning for symbols
  281. exported from assembly code.
  282. config HAVE_REGS_AND_STACK_ACCESS_API
  283. bool
  284. help
  285. This symbol should be selected by an architecture if it supports
  286. the API needed to access registers and stack entries from pt_regs,
  287. declared in asm/ptrace.h
  288. For example the kprobes-based event tracer needs this API.
  289. config HAVE_RSEQ
  290. bool
  291. depends on HAVE_REGS_AND_STACK_ACCESS_API
  292. help
  293. This symbol should be selected by an architecture if it
  294. supports an implementation of restartable sequences.
  295. config HAVE_RUST
  296. bool
  297. help
  298. This symbol should be selected by an architecture if it
  299. supports Rust.
  300. config HAVE_FUNCTION_ARG_ACCESS_API
  301. bool
  302. help
  303. This symbol should be selected by an architecture if it supports
  304. the API needed to access function arguments from pt_regs,
  305. declared in asm/ptrace.h
  306. config HAVE_HW_BREAKPOINT
  307. bool
  308. depends on PERF_EVENTS
  309. config HAVE_MIXED_BREAKPOINTS_REGS
  310. bool
  311. depends on HAVE_HW_BREAKPOINT
  312. help
  313. Depending on the arch implementation of hardware breakpoints,
  314. some of them have separate registers for data and instruction
  315. breakpoints addresses, others have mixed registers to store
  316. them but define the access type in a control register.
  317. Select this option if your arch implements breakpoints under the
  318. latter fashion.
  319. config HAVE_USER_RETURN_NOTIFIER
  320. bool
  321. config HAVE_PERF_EVENTS_NMI
  322. bool
  323. help
  324. System hardware can generate an NMI using the perf event
  325. subsystem. Also has support for calculating CPU cycle events
  326. to determine how many clock cycles in a given period.
  327. config HAVE_HARDLOCKUP_DETECTOR_PERF
  328. bool
  329. depends on HAVE_PERF_EVENTS_NMI
  330. help
  331. The arch chooses to use the generic perf-NMI-based hardlockup
  332. detector. Must define HAVE_PERF_EVENTS_NMI.
  333. config HAVE_NMI_WATCHDOG
  334. depends on HAVE_NMI
  335. bool
  336. help
  337. The arch provides a low level NMI watchdog. It provides
  338. asm/nmi.h, and defines its own arch_touch_nmi_watchdog().
  339. config HAVE_HARDLOCKUP_DETECTOR_ARCH
  340. bool
  341. select HAVE_NMI_WATCHDOG
  342. help
  343. The arch chooses to provide its own hardlockup detector, which is
  344. a superset of the HAVE_NMI_WATCHDOG. It also conforms to config
  345. interfaces and parameters provided by hardlockup detector subsystem.
  346. config HAVE_PERF_REGS
  347. bool
  348. help
  349. Support selective register dumps for perf events. This includes
  350. bit-mapping of each registers and a unique architecture id.
  351. config HAVE_PERF_USER_STACK_DUMP
  352. bool
  353. help
  354. Support user stack dumps for perf event samples. This needs
  355. access to the user stack pointer which is not unified across
  356. architectures.
  357. config HAVE_ARCH_JUMP_LABEL
  358. bool
  359. config HAVE_ARCH_JUMP_LABEL_RELATIVE
  360. bool
  361. config MMU_GATHER_TABLE_FREE
  362. bool
  363. config MMU_GATHER_RCU_TABLE_FREE
  364. bool
  365. select MMU_GATHER_TABLE_FREE
  366. config MMU_GATHER_PAGE_SIZE
  367. bool
  368. config MMU_GATHER_NO_RANGE
  369. bool
  370. select MMU_GATHER_MERGE_VMAS
  371. config MMU_GATHER_NO_FLUSH_CACHE
  372. bool
  373. config MMU_GATHER_MERGE_VMAS
  374. bool
  375. config MMU_GATHER_NO_GATHER
  376. bool
  377. depends on MMU_GATHER_TABLE_FREE
  378. config ARCH_WANT_IRQS_OFF_ACTIVATE_MM
  379. bool
  380. help
  381. Temporary select until all architectures can be converted to have
  382. irqs disabled over activate_mm. Architectures that do IPI based TLB
  383. shootdowns should enable this.
  384. config ARCH_HAVE_NMI_SAFE_CMPXCHG
  385. bool
  386. config HAVE_ALIGNED_STRUCT_PAGE
  387. bool
  388. help
  389. This makes sure that struct pages are double word aligned and that
  390. e.g. the SLUB allocator can perform double word atomic operations
  391. on a struct page for better performance. However selecting this
  392. might increase the size of a struct page by a word.
  393. config HAVE_CMPXCHG_LOCAL
  394. bool
  395. config HAVE_CMPXCHG_DOUBLE
  396. bool
  397. config ARCH_WEAK_RELEASE_ACQUIRE
  398. bool
  399. config ARCH_WANT_IPC_PARSE_VERSION
  400. bool
  401. config ARCH_WANT_COMPAT_IPC_PARSE_VERSION
  402. bool
  403. config ARCH_WANT_OLD_COMPAT_IPC
  404. select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
  405. bool
  406. config HAVE_ARCH_SECCOMP
  407. bool
  408. help
  409. An arch should select this symbol to support seccomp mode 1 (the fixed
  410. syscall policy), and must provide an overrides for __NR_seccomp_sigreturn,
  411. and compat syscalls if the asm-generic/seccomp.h defaults need adjustment:
  412. - __NR_seccomp_read_32
  413. - __NR_seccomp_write_32
  414. - __NR_seccomp_exit_32
  415. - __NR_seccomp_sigreturn_32
  416. config HAVE_ARCH_SECCOMP_FILTER
  417. bool
  418. select HAVE_ARCH_SECCOMP
  419. help
  420. An arch should select this symbol if it provides all of these things:
  421. - all the requirements for HAVE_ARCH_SECCOMP
  422. - syscall_get_arch()
  423. - syscall_get_arguments()
  424. - syscall_rollback()
  425. - syscall_set_return_value()
  426. - SIGSYS siginfo_t support
  427. - secure_computing is called from a ptrace_event()-safe context
  428. - secure_computing return value is checked and a return value of -1
  429. results in the system call being skipped immediately.
  430. - seccomp syscall wired up
  431. - if !HAVE_SPARSE_SYSCALL_NR, have SECCOMP_ARCH_NATIVE,
  432. SECCOMP_ARCH_NATIVE_NR, SECCOMP_ARCH_NATIVE_NAME defined. If
  433. COMPAT is supported, have the SECCOMP_ARCH_COMPAT* defines too.
  434. config SECCOMP
  435. prompt "Enable seccomp to safely execute untrusted bytecode"
  436. def_bool y
  437. depends on HAVE_ARCH_SECCOMP
  438. help
  439. This kernel feature is useful for number crunching applications
  440. that may need to handle untrusted bytecode during their
  441. execution. By using pipes or other transports made available
  442. to the process as file descriptors supporting the read/write
  443. syscalls, it's possible to isolate those applications in their
  444. own address space using seccomp. Once seccomp is enabled via
  445. prctl(PR_SET_SECCOMP) or the seccomp() syscall, it cannot be
  446. disabled and the task is only allowed to execute a few safe
  447. syscalls defined by each seccomp mode.
  448. If unsure, say Y.
  449. config SECCOMP_FILTER
  450. def_bool y
  451. depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
  452. help
  453. Enable tasks to build secure computing environments defined
  454. in terms of Berkeley Packet Filter programs which implement
  455. task-defined system call filtering polices.
  456. See Documentation/userspace-api/seccomp_filter.rst for details.
  457. config SECCOMP_CACHE_DEBUG
  458. bool "Show seccomp filter cache status in /proc/pid/seccomp_cache"
  459. depends on SECCOMP_FILTER && !HAVE_SPARSE_SYSCALL_NR
  460. depends on PROC_FS
  461. help
  462. This enables the /proc/pid/seccomp_cache interface to monitor
  463. seccomp cache data. The file format is subject to change. Reading
  464. the file requires CAP_SYS_ADMIN.
  465. This option is for debugging only. Enabling presents the risk that
  466. an adversary may be able to infer the seccomp filter logic.
  467. If unsure, say N.
  468. config HAVE_ARCH_STACKLEAK
  469. bool
  470. help
  471. An architecture should select this if it has the code which
  472. fills the used part of the kernel stack with the STACKLEAK_POISON
  473. value before returning from system calls.
  474. config HAVE_STACKPROTECTOR
  475. bool
  476. help
  477. An arch should select this symbol if:
  478. - it has implemented a stack canary (e.g. __stack_chk_guard)
  479. config STACKPROTECTOR
  480. bool "Stack Protector buffer overflow detection"
  481. depends on HAVE_STACKPROTECTOR
  482. depends on $(cc-option,-fstack-protector)
  483. default y
  484. help
  485. This option turns on the "stack-protector" GCC feature. This
  486. feature puts, at the beginning of functions, a canary value on
  487. the stack just before the return address, and validates
  488. the value just before actually returning. Stack based buffer
  489. overflows (that need to overwrite this return address) now also
  490. overwrite the canary, which gets detected and the attack is then
  491. neutralized via a kernel panic.
  492. Functions will have the stack-protector canary logic added if they
  493. have an 8-byte or larger character array on the stack.
  494. This feature requires gcc version 4.2 or above, or a distribution
  495. gcc with the feature backported ("-fstack-protector").
  496. On an x86 "defconfig" build, this feature adds canary checks to
  497. about 3% of all kernel functions, which increases kernel code size
  498. by about 0.3%.
  499. config STACKPROTECTOR_STRONG
  500. bool "Strong Stack Protector"
  501. depends on STACKPROTECTOR
  502. depends on $(cc-option,-fstack-protector-strong)
  503. default y
  504. help
  505. Functions will have the stack-protector canary logic added in any
  506. of the following conditions:
  507. - local variable's address used as part of the right hand side of an
  508. assignment or function argument
  509. - local variable is an array (or union containing an array),
  510. regardless of array type or length
  511. - uses register local variables
  512. This feature requires gcc version 4.9 or above, or a distribution
  513. gcc with the feature backported ("-fstack-protector-strong").
  514. On an x86 "defconfig" build, this feature adds canary checks to
  515. about 20% of all kernel functions, which increases the kernel code
  516. size by about 2%.
  517. config ARCH_SUPPORTS_SHADOW_CALL_STACK
  518. bool
  519. help
  520. An architecture should select this if it supports the compiler's
  521. Shadow Call Stack and implements runtime support for shadow stack
  522. switching.
  523. config SHADOW_CALL_STACK
  524. bool "Shadow Call Stack"
  525. depends on ARCH_SUPPORTS_SHADOW_CALL_STACK
  526. depends on DYNAMIC_FTRACE_WITH_ARGS || DYNAMIC_FTRACE_WITH_REGS || !FUNCTION_GRAPH_TRACER
  527. help
  528. This option enables the compiler's Shadow Call Stack, which
  529. uses a shadow stack to protect function return addresses from
  530. being overwritten by an attacker. More information can be found
  531. in the compiler's documentation:
  532. - Clang: https://clang.llvm.org/docs/ShadowCallStack.html
  533. - GCC: https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#Instrumentation-Options
  534. Note that security guarantees in the kernel differ from the
  535. ones documented for user space. The kernel must store addresses
  536. of shadow stacks in memory, which means an attacker capable of
  537. reading and writing arbitrary memory may be able to locate them
  538. and hijack control flow by modifying the stacks.
  539. config DYNAMIC_SCS
  540. bool
  541. help
  542. Set by the arch code if it relies on code patching to insert the
  543. shadow call stack push and pop instructions rather than on the
  544. compiler.
  545. config LTO
  546. bool
  547. help
  548. Selected if the kernel will be built using the compiler's LTO feature.
  549. config LTO_CLANG
  550. bool
  551. select LTO
  552. help
  553. Selected if the kernel will be built using Clang's LTO feature.
  554. config ARCH_SUPPORTS_LTO_CLANG
  555. bool
  556. help
  557. An architecture should select this option if it supports:
  558. - compiling with Clang,
  559. - compiling inline assembly with Clang's integrated assembler,
  560. - and linking with LLD.
  561. config ARCH_SUPPORTS_LTO_CLANG_THIN
  562. bool
  563. help
  564. An architecture should select this option if it can support Clang's
  565. ThinLTO mode.
  566. config HAS_LTO_CLANG
  567. def_bool y
  568. depends on CC_IS_CLANG && LD_IS_LLD && AS_IS_LLVM
  569. depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm)
  570. depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm)
  571. depends on ARCH_SUPPORTS_LTO_CLANG
  572. depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT
  573. depends on !KASAN || KASAN_HW_TAGS
  574. depends on !GCOV_KERNEL
  575. help
  576. The compiler and Kconfig options support building with Clang's
  577. LTO.
  578. choice
  579. prompt "Link Time Optimization (LTO)"
  580. default LTO_NONE
  581. help
  582. This option enables Link Time Optimization (LTO), which allows the
  583. compiler to optimize binaries globally.
  584. If unsure, select LTO_NONE. Note that LTO is very resource-intensive
  585. so it's disabled by default.
  586. config LTO_NONE
  587. bool "None"
  588. help
  589. Build the kernel normally, without Link Time Optimization (LTO).
  590. config LTO_CLANG_FULL
  591. bool "Clang Full LTO (EXPERIMENTAL)"
  592. depends on HAS_LTO_CLANG
  593. depends on !COMPILE_TEST
  594. select LTO_CLANG
  595. help
  596. This option enables Clang's full Link Time Optimization (LTO), which
  597. allows the compiler to optimize the kernel globally. If you enable
  598. this option, the compiler generates LLVM bitcode instead of ELF
  599. object files, and the actual compilation from bitcode happens at
  600. the LTO link step, which may take several minutes depending on the
  601. kernel configuration. More information can be found from LLVM's
  602. documentation:
  603. https://llvm.org/docs/LinkTimeOptimization.html
  604. During link time, this option can use a large amount of RAM, and
  605. may take much longer than the ThinLTO option.
  606. config LTO_CLANG_THIN
  607. bool "Clang ThinLTO (EXPERIMENTAL)"
  608. depends on HAS_LTO_CLANG && ARCH_SUPPORTS_LTO_CLANG_THIN
  609. select LTO_CLANG
  610. help
  611. This option enables Clang's ThinLTO, which allows for parallel
  612. optimization and faster incremental compiles compared to the
  613. CONFIG_LTO_CLANG_FULL option. More information can be found
  614. from Clang's documentation:
  615. https://clang.llvm.org/docs/ThinLTO.html
  616. If unsure, say Y.
  617. endchoice
  618. config ARCH_SUPPORTS_CFI_CLANG
  619. bool
  620. help
  621. An architecture should select this option if it can support Clang's
  622. Control-Flow Integrity (CFI) checking.
  623. config ARCH_USES_CFI_TRAPS
  624. bool
  625. config CFI_CLANG
  626. bool "Use Clang's Control Flow Integrity (CFI)"
  627. depends on ARCH_SUPPORTS_CFI_CLANG
  628. depends on $(cc-option,-fsanitize=kcfi)
  629. help
  630. This option enables Clang’s forward-edge Control Flow Integrity
  631. (CFI) checking, where the compiler injects a runtime check to each
  632. indirect function call to ensure the target is a valid function with
  633. the correct static type. This restricts possible call targets and
  634. makes it more difficult for an attacker to exploit bugs that allow
  635. the modification of stored function pointers. More information can be
  636. found from Clang's documentation:
  637. https://clang.llvm.org/docs/ControlFlowIntegrity.html
  638. config CFI_PERMISSIVE
  639. bool "Use CFI in permissive mode"
  640. depends on CFI_CLANG
  641. help
  642. When selected, Control Flow Integrity (CFI) violations result in a
  643. warning instead of a kernel panic. This option should only be used
  644. for finding indirect call type mismatches during development.
  645. If unsure, say N.
  646. config HAVE_ARCH_WITHIN_STACK_FRAMES
  647. bool
  648. help
  649. An architecture should select this if it can walk the kernel stack
  650. frames to determine if an object is part of either the arguments
  651. or local variables (i.e. that it excludes saved return addresses,
  652. and similar) by implementing an inline arch_within_stack_frames(),
  653. which is used by CONFIG_HARDENED_USERCOPY.
  654. config HAVE_CONTEXT_TRACKING_USER
  655. bool
  656. help
  657. Provide kernel/user boundaries probes necessary for subsystems
  658. that need it, such as userspace RCU extended quiescent state.
  659. Syscalls need to be wrapped inside user_exit()-user_enter(), either
  660. optimized behind static key or through the slow path using TIF_NOHZ
  661. flag. Exceptions handlers must be wrapped as well. Irqs are already
  662. protected inside ct_irq_enter/ct_irq_exit() but preemption or signal
  663. handling on irq exit still need to be protected.
  664. config HAVE_CONTEXT_TRACKING_USER_OFFSTACK
  665. bool
  666. help
  667. Architecture neither relies on exception_enter()/exception_exit()
  668. nor on schedule_user(). Also preempt_schedule_notrace() and
  669. preempt_schedule_irq() can't be called in a preemptible section
  670. while context tracking is CONTEXT_USER. This feature reflects a sane
  671. entry implementation where the following requirements are met on
  672. critical entry code, ie: before user_exit() or after user_enter():
  673. - Critical entry code isn't preemptible (or better yet:
  674. not interruptible).
  675. - No use of RCU read side critical sections, unless ct_nmi_enter()
  676. got called.
  677. - No use of instrumentation, unless instrumentation_begin() got
  678. called.
  679. config HAVE_TIF_NOHZ
  680. bool
  681. help
  682. Arch relies on TIF_NOHZ and syscall slow path to implement context
  683. tracking calls to user_enter()/user_exit().
  684. config HAVE_VIRT_CPU_ACCOUNTING
  685. bool
  686. config HAVE_VIRT_CPU_ACCOUNTING_IDLE
  687. bool
  688. help
  689. Architecture has its own way to account idle CPU time and therefore
  690. doesn't implement vtime_account_idle().
  691. config ARCH_HAS_SCALED_CPUTIME
  692. bool
  693. config HAVE_VIRT_CPU_ACCOUNTING_GEN
  694. bool
  695. default y if 64BIT
  696. help
  697. With VIRT_CPU_ACCOUNTING_GEN, cputime_t becomes 64-bit.
  698. Before enabling this option, arch code must be audited
  699. to ensure there are no races in concurrent read/write of
  700. cputime_t. For example, reading/writing 64-bit cputime_t on
  701. some 32-bit arches may require multiple accesses, so proper
  702. locking is needed to protect against concurrent accesses.
  703. config HAVE_IRQ_TIME_ACCOUNTING
  704. bool
  705. help
  706. Archs need to ensure they use a high enough resolution clock to
  707. support irq time accounting and then call enable_sched_clock_irqtime().
  708. config HAVE_MOVE_PUD
  709. bool
  710. help
  711. Architectures that select this are able to move page tables at the
  712. PUD level. If there are only 3 page table levels, the move effectively
  713. happens at the PGD level.
  714. config HAVE_MOVE_PMD
  715. bool
  716. help
  717. Archs that select this are able to move page tables at the PMD level.
  718. config HAVE_ARCH_TRANSPARENT_HUGEPAGE
  719. bool
  720. config HAVE_ARCH_TRANSPARENT_HUGEPAGE_PUD
  721. bool
  722. config HAVE_ARCH_HUGE_VMAP
  723. bool
  724. #
  725. # Archs that select this would be capable of PMD-sized vmaps (i.e.,
  726. # arch_vmap_pmd_supported() returns true). The VM_ALLOW_HUGE_VMAP flag
  727. # must be used to enable allocations to use hugepages.
  728. #
  729. config HAVE_ARCH_HUGE_VMALLOC
  730. depends on HAVE_ARCH_HUGE_VMAP
  731. bool
  732. config ARCH_WANT_HUGE_PMD_SHARE
  733. bool
  734. config HAVE_ARCH_SOFT_DIRTY
  735. bool
  736. config HAVE_MOD_ARCH_SPECIFIC
  737. bool
  738. help
  739. The arch uses struct mod_arch_specific to store data. Many arches
  740. just need a simple module loader without arch specific data - those
  741. should not enable this.
  742. config MODULES_USE_ELF_RELA
  743. bool
  744. help
  745. Modules only use ELF RELA relocations. Modules with ELF REL
  746. relocations will give an error.
  747. config MODULES_USE_ELF_REL
  748. bool
  749. help
  750. Modules only use ELF REL relocations. Modules with ELF RELA
  751. relocations will give an error.
  752. config ARCH_WANTS_MODULES_DATA_IN_VMALLOC
  753. bool
  754. help
  755. For architectures like powerpc/32 which have constraints on module
  756. allocation and need to allocate module data outside of module area.
  757. config HAVE_IRQ_EXIT_ON_IRQ_STACK
  758. bool
  759. help
  760. Architecture doesn't only execute the irq handler on the irq stack
  761. but also irq_exit(). This way we can process softirqs on this irq
  762. stack instead of switching to a new one when we call __do_softirq()
  763. in the end of an hardirq.
  764. This spares a stack switch and improves cache usage on softirq
  765. processing.
  766. config HAVE_SOFTIRQ_ON_OWN_STACK
  767. bool
  768. help
  769. Architecture provides a function to run __do_softirq() on a
  770. separate stack.
  771. config SOFTIRQ_ON_OWN_STACK
  772. def_bool HAVE_SOFTIRQ_ON_OWN_STACK && !PREEMPT_RT
  773. config ALTERNATE_USER_ADDRESS_SPACE
  774. bool
  775. help
  776. Architectures set this when the CPU uses separate address
  777. spaces for kernel and user space pointers. In this case, the
  778. access_ok() check on a __user pointer is skipped.
  779. config PGTABLE_LEVELS
  780. int
  781. default 2
  782. config ARCH_HAS_ELF_RANDOMIZE
  783. bool
  784. help
  785. An architecture supports choosing randomized locations for
  786. stack, mmap, brk, and ET_DYN. Defined functions:
  787. - arch_mmap_rnd()
  788. - arch_randomize_brk()
  789. config HAVE_ARCH_MMAP_RND_BITS
  790. bool
  791. help
  792. An arch should select this symbol if it supports setting a variable
  793. number of bits for use in establishing the base address for mmap
  794. allocations, has MMU enabled and provides values for both:
  795. - ARCH_MMAP_RND_BITS_MIN
  796. - ARCH_MMAP_RND_BITS_MAX
  797. config HAVE_EXIT_THREAD
  798. bool
  799. help
  800. An architecture implements exit_thread.
  801. config ARCH_MMAP_RND_BITS_MIN
  802. int
  803. config ARCH_MMAP_RND_BITS_MAX
  804. int
  805. config ARCH_MMAP_RND_BITS_DEFAULT
  806. int
  807. config ARCH_MMAP_RND_BITS
  808. int "Number of bits to use for ASLR of mmap base address" if EXPERT
  809. range ARCH_MMAP_RND_BITS_MIN ARCH_MMAP_RND_BITS_MAX
  810. default ARCH_MMAP_RND_BITS_DEFAULT if ARCH_MMAP_RND_BITS_DEFAULT
  811. default ARCH_MMAP_RND_BITS_MIN
  812. depends on HAVE_ARCH_MMAP_RND_BITS
  813. help
  814. This value can be used to select the number of bits to use to
  815. determine the random offset to the base address of vma regions
  816. resulting from mmap allocations. This value will be bounded
  817. by the architecture's minimum and maximum supported values.
  818. This value can be changed after boot using the
  819. /proc/sys/vm/mmap_rnd_bits tunable
  820. config HAVE_ARCH_MMAP_RND_COMPAT_BITS
  821. bool
  822. help
  823. An arch should select this symbol if it supports running applications
  824. in compatibility mode, supports setting a variable number of bits for
  825. use in establishing the base address for mmap allocations, has MMU
  826. enabled and provides values for both:
  827. - ARCH_MMAP_RND_COMPAT_BITS_MIN
  828. - ARCH_MMAP_RND_COMPAT_BITS_MAX
  829. config ARCH_MMAP_RND_COMPAT_BITS_MIN
  830. int
  831. config ARCH_MMAP_RND_COMPAT_BITS_MAX
  832. int
  833. config ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
  834. int
  835. config ARCH_MMAP_RND_COMPAT_BITS
  836. int "Number of bits to use for ASLR of mmap base address for compatible applications" if EXPERT
  837. range ARCH_MMAP_RND_COMPAT_BITS_MIN ARCH_MMAP_RND_COMPAT_BITS_MAX
  838. default ARCH_MMAP_RND_COMPAT_BITS_DEFAULT if ARCH_MMAP_RND_COMPAT_BITS_DEFAULT
  839. default ARCH_MMAP_RND_COMPAT_BITS_MIN
  840. depends on HAVE_ARCH_MMAP_RND_COMPAT_BITS
  841. help
  842. This value can be used to select the number of bits to use to
  843. determine the random offset to the base address of vma regions
  844. resulting from mmap allocations for compatible applications This
  845. value will be bounded by the architecture's minimum and maximum
  846. supported values.
  847. This value can be changed after boot using the
  848. /proc/sys/vm/mmap_rnd_compat_bits tunable
  849. config HAVE_ARCH_COMPAT_MMAP_BASES
  850. bool
  851. help
  852. This allows 64bit applications to invoke 32-bit mmap() syscall
  853. and vice-versa 32-bit applications to call 64-bit mmap().
  854. Required for applications doing different bitness syscalls.
  855. config PAGE_SIZE_LESS_THAN_64KB
  856. def_bool y
  857. depends on !ARM64_64K_PAGES
  858. depends on !IA64_PAGE_SIZE_64KB
  859. depends on !PAGE_SIZE_64KB
  860. depends on !PARISC_PAGE_SIZE_64KB
  861. depends on PAGE_SIZE_LESS_THAN_256KB
  862. config PAGE_SIZE_LESS_THAN_256KB
  863. def_bool y
  864. depends on !PAGE_SIZE_256KB
  865. # This allows to use a set of generic functions to determine mmap base
  866. # address by giving priority to top-down scheme only if the process
  867. # is not in legacy mode (compat task, unlimited stack size or
  868. # sysctl_legacy_va_layout).
  869. # Architecture that selects this option can provide its own version of:
  870. # - STACK_RND_MASK
  871. config ARCH_WANT_DEFAULT_TOPDOWN_MMAP_LAYOUT
  872. bool
  873. depends on MMU
  874. select ARCH_HAS_ELF_RANDOMIZE
  875. config HAVE_OBJTOOL
  876. bool
  877. config HAVE_JUMP_LABEL_HACK
  878. bool
  879. config HAVE_NOINSTR_HACK
  880. bool
  881. config HAVE_NOINSTR_VALIDATION
  882. bool
  883. config HAVE_UACCESS_VALIDATION
  884. bool
  885. select OBJTOOL
  886. config HAVE_STACK_VALIDATION
  887. bool
  888. help
  889. Architecture supports objtool compile-time frame pointer rule
  890. validation.
  891. config HAVE_RELIABLE_STACKTRACE
  892. bool
  893. help
  894. Architecture has either save_stack_trace_tsk_reliable() or
  895. arch_stack_walk_reliable() function which only returns a stack trace
  896. if it can guarantee the trace is reliable.
  897. config HAVE_ARCH_HASH
  898. bool
  899. default n
  900. help
  901. If this is set, the architecture provides an <asm/hash.h>
  902. file which provides platform-specific implementations of some
  903. functions in <linux/hash.h> or fs/namei.c.
  904. config HAVE_ARCH_NVRAM_OPS
  905. bool
  906. config ISA_BUS_API
  907. def_bool ISA
  908. #
  909. # ABI hall of shame
  910. #
  911. config CLONE_BACKWARDS
  912. bool
  913. help
  914. Architecture has tls passed as the 4th argument of clone(2),
  915. not the 5th one.
  916. config CLONE_BACKWARDS2
  917. bool
  918. help
  919. Architecture has the first two arguments of clone(2) swapped.
  920. config CLONE_BACKWARDS3
  921. bool
  922. help
  923. Architecture has tls passed as the 3rd argument of clone(2),
  924. not the 5th one.
  925. config ODD_RT_SIGACTION
  926. bool
  927. help
  928. Architecture has unusual rt_sigaction(2) arguments
  929. config OLD_SIGSUSPEND
  930. bool
  931. help
  932. Architecture has old sigsuspend(2) syscall, of one-argument variety
  933. config OLD_SIGSUSPEND3
  934. bool
  935. help
  936. Even weirder antique ABI - three-argument sigsuspend(2)
  937. config OLD_SIGACTION
  938. bool
  939. help
  940. Architecture has old sigaction(2) syscall. Nope, not the same
  941. as OLD_SIGSUSPEND | OLD_SIGSUSPEND3 - alpha has sigsuspend(2),
  942. but fairly different variant of sigaction(2), thanks to OSF/1
  943. compatibility...
  944. config COMPAT_OLD_SIGACTION
  945. bool
  946. config COMPAT_32BIT_TIME
  947. bool "Provide system calls for 32-bit time_t"
  948. default !64BIT || COMPAT
  949. help
  950. This enables 32 bit time_t support in addition to 64 bit time_t support.
  951. This is relevant on all 32-bit architectures, and 64-bit architectures
  952. as part of compat syscall handling.
  953. config ARCH_NO_PREEMPT
  954. bool
  955. config ARCH_EPHEMERAL_INODES
  956. def_bool n
  957. help
  958. An arch should select this symbol if it doesn't keep track of inode
  959. instances on its own, but instead relies on something else (e.g. the
  960. host kernel for an UML kernel).
  961. config ARCH_SUPPORTS_RT
  962. bool
  963. config CPU_NO_EFFICIENT_FFS
  964. def_bool n
  965. config HAVE_ARCH_VMAP_STACK
  966. def_bool n
  967. help
  968. An arch should select this symbol if it can support kernel stacks
  969. in vmalloc space. This means:
  970. - vmalloc space must be large enough to hold many kernel stacks.
  971. This may rule out many 32-bit architectures.
  972. - Stacks in vmalloc space need to work reliably. For example, if
  973. vmap page tables are created on demand, either this mechanism
  974. needs to work while the stack points to a virtual address with
  975. unpopulated page tables or arch code (switch_to() and switch_mm(),
  976. most likely) needs to ensure that the stack's page table entries
  977. are populated before running on a possibly unpopulated stack.
  978. - If the stack overflows into a guard page, something reasonable
  979. should happen. The definition of "reasonable" is flexible, but
  980. instantly rebooting without logging anything would be unfriendly.
  981. config VMAP_STACK
  982. default y
  983. bool "Use a virtually-mapped stack"
  984. depends on HAVE_ARCH_VMAP_STACK
  985. depends on !KASAN || KASAN_HW_TAGS || KASAN_VMALLOC
  986. help
  987. Enable this if you want the use virtually-mapped kernel stacks
  988. with guard pages. This causes kernel stack overflows to be
  989. caught immediately rather than causing difficult-to-diagnose
  990. corruption.
  991. To use this with software KASAN modes, the architecture must support
  992. backing virtual mappings with real shadow memory, and KASAN_VMALLOC
  993. must be enabled.
  994. config HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
  995. def_bool n
  996. help
  997. An arch should select this symbol if it can support kernel stack
  998. offset randomization with calls to add_random_kstack_offset()
  999. during syscall entry and choose_random_kstack_offset() during
  1000. syscall exit. Careful removal of -fstack-protector-strong and
  1001. -fstack-protector should also be applied to the entry code and
  1002. closely examined, as the artificial stack bump looks like an array
  1003. to the compiler, so it will attempt to add canary checks regardless
  1004. of the static branch state.
  1005. config RANDOMIZE_KSTACK_OFFSET
  1006. bool "Support for randomizing kernel stack offset on syscall entry" if EXPERT
  1007. default y
  1008. depends on HAVE_ARCH_RANDOMIZE_KSTACK_OFFSET
  1009. depends on INIT_STACK_NONE || !CC_IS_CLANG || CLANG_VERSION >= 140000
  1010. help
  1011. The kernel stack offset can be randomized (after pt_regs) by
  1012. roughly 5 bits of entropy, frustrating memory corruption
  1013. attacks that depend on stack address determinism or
  1014. cross-syscall address exposures.
  1015. The feature is controlled via the "randomize_kstack_offset=on/off"
  1016. kernel boot param, and if turned off has zero overhead due to its use
  1017. of static branches (see JUMP_LABEL).
  1018. If unsure, say Y.
  1019. config RANDOMIZE_KSTACK_OFFSET_DEFAULT
  1020. bool "Default state of kernel stack offset randomization"
  1021. depends on RANDOMIZE_KSTACK_OFFSET
  1022. help
  1023. Kernel stack offset randomization is controlled by kernel boot param
  1024. "randomize_kstack_offset=on/off", and this config chooses the default
  1025. boot state.
  1026. config ARCH_OPTIONAL_KERNEL_RWX
  1027. def_bool n
  1028. config ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
  1029. def_bool n
  1030. config ARCH_HAS_STRICT_KERNEL_RWX
  1031. def_bool n
  1032. config STRICT_KERNEL_RWX
  1033. bool "Make kernel text and rodata read-only" if ARCH_OPTIONAL_KERNEL_RWX
  1034. depends on ARCH_HAS_STRICT_KERNEL_RWX
  1035. default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
  1036. help
  1037. If this is set, kernel text and rodata memory will be made read-only,
  1038. and non-text memory will be made non-executable. This provides
  1039. protection against certain security exploits (e.g. executing the heap
  1040. or modifying text)
  1041. These features are considered standard security practice these days.
  1042. You should say Y here in almost all cases.
  1043. config ARCH_HAS_STRICT_MODULE_RWX
  1044. def_bool n
  1045. config STRICT_MODULE_RWX
  1046. bool "Set loadable kernel module data as NX and text as RO" if ARCH_OPTIONAL_KERNEL_RWX
  1047. depends on ARCH_HAS_STRICT_MODULE_RWX && MODULES
  1048. default !ARCH_OPTIONAL_KERNEL_RWX || ARCH_OPTIONAL_KERNEL_RWX_DEFAULT
  1049. help
  1050. If this is set, module text and rodata memory will be made read-only,
  1051. and non-text memory will be made non-executable. This provides
  1052. protection against certain security exploits (e.g. writing to text)
  1053. # select if the architecture provides an asm/dma-direct.h header
  1054. config ARCH_HAS_PHYS_TO_DMA
  1055. bool
  1056. config HAVE_ARCH_COMPILER_H
  1057. bool
  1058. help
  1059. An architecture can select this if it provides an
  1060. asm/compiler.h header that should be included after
  1061. linux/compiler-*.h in order to override macro definitions that those
  1062. headers generally provide.
  1063. config HAVE_ARCH_PREL32_RELOCATIONS
  1064. bool
  1065. help
  1066. May be selected by an architecture if it supports place-relative
  1067. 32-bit relocations, both in the toolchain and in the module loader,
  1068. in which case relative references can be used in special sections
  1069. for PCI fixup, initcalls etc which are only half the size on 64 bit
  1070. architectures, and don't require runtime relocation on relocatable
  1071. kernels.
  1072. config ARCH_USE_MEMREMAP_PROT
  1073. bool
  1074. config LOCK_EVENT_COUNTS
  1075. bool "Locking event counts collection"
  1076. depends on DEBUG_FS
  1077. help
  1078. Enable light-weight counting of various locking related events
  1079. in the system with minimal performance impact. This reduces
  1080. the chance of application behavior change because of timing
  1081. differences. The counts are reported via debugfs.
  1082. # Select if the architecture has support for applying RELR relocations.
  1083. config ARCH_HAS_RELR
  1084. bool
  1085. config RELR
  1086. bool "Use RELR relocation packing"
  1087. depends on ARCH_HAS_RELR && TOOLS_SUPPORT_RELR
  1088. default y
  1089. help
  1090. Store the kernel's dynamic relocations in the RELR relocation packing
  1091. format. Requires a compatible linker (LLD supports this feature), as
  1092. well as compatible NM and OBJCOPY utilities (llvm-nm and llvm-objcopy
  1093. are compatible).
  1094. config ARCH_HAS_MEM_ENCRYPT
  1095. bool
  1096. config ARCH_HAS_MEM_RELINQUISH
  1097. bool
  1098. config ARCH_HAS_CC_PLATFORM
  1099. bool
  1100. config HAVE_SPARSE_SYSCALL_NR
  1101. bool
  1102. help
  1103. An architecture should select this if its syscall numbering is sparse
  1104. to save space. For example, MIPS architecture has a syscall array with
  1105. entries at 4000, 5000 and 6000 locations. This option turns on syscall
  1106. related optimizations for a given architecture.
  1107. config ARCH_HAS_VDSO_DATA
  1108. bool
  1109. config HAVE_STATIC_CALL
  1110. bool
  1111. config HAVE_STATIC_CALL_INLINE
  1112. bool
  1113. depends on HAVE_STATIC_CALL
  1114. select OBJTOOL
  1115. config HAVE_PREEMPT_DYNAMIC
  1116. bool
  1117. config HAVE_PREEMPT_DYNAMIC_CALL
  1118. bool
  1119. depends on HAVE_STATIC_CALL
  1120. select HAVE_PREEMPT_DYNAMIC
  1121. help
  1122. An architecture should select this if it can handle the preemption
  1123. model being selected at boot time using static calls.
  1124. Where an architecture selects HAVE_STATIC_CALL_INLINE, any call to a
  1125. preemption function will be patched directly.
  1126. Where an architecture does not select HAVE_STATIC_CALL_INLINE, any
  1127. call to a preemption function will go through a trampoline, and the
  1128. trampoline will be patched.
  1129. It is strongly advised to support inline static call to avoid any
  1130. overhead.
  1131. config HAVE_PREEMPT_DYNAMIC_KEY
  1132. bool
  1133. depends on HAVE_ARCH_JUMP_LABEL
  1134. select HAVE_PREEMPT_DYNAMIC
  1135. help
  1136. An architecture should select this if it can handle the preemption
  1137. model being selected at boot time using static keys.
  1138. Each preemption function will be given an early return based on a
  1139. static key. This should have slightly lower overhead than non-inline
  1140. static calls, as this effectively inlines each trampoline into the
  1141. start of its callee. This may avoid redundant work, and may
  1142. integrate better with CFI schemes.
  1143. This will have greater overhead than using inline static calls as
  1144. the call to the preemption function cannot be entirely elided.
  1145. config ARCH_WANT_LD_ORPHAN_WARN
  1146. bool
  1147. help
  1148. An arch should select this symbol once all linker sections are explicitly
  1149. included, size-asserted, or discarded in the linker scripts. This is
  1150. important because we never want expected sections to be placed heuristically
  1151. by the linker, since the locations of such sections can change between linker
  1152. versions.
  1153. config HAVE_ARCH_PFN_VALID
  1154. bool
  1155. config ARCH_SUPPORTS_DEBUG_PAGEALLOC
  1156. bool
  1157. config ARCH_SUPPORTS_PAGE_TABLE_CHECK
  1158. bool
  1159. config ARCH_SPLIT_ARG64
  1160. bool
  1161. help
  1162. If a 32-bit architecture requires 64-bit arguments to be split into
  1163. pairs of 32-bit arguments, select this option.
  1164. config ARCH_HAS_ELFCORE_COMPAT
  1165. bool
  1166. config ARCH_HAS_PARANOID_L1D_FLUSH
  1167. bool
  1168. config ARCH_HAVE_TRACE_MMIO_ACCESS
  1169. bool
  1170. config DYNAMIC_SIGFRAME
  1171. bool
  1172. # Select, if arch has a named attribute group bound to NUMA device nodes.
  1173. config HAVE_ARCH_NODE_DEV_GROUP
  1174. bool
  1175. config ARCH_HAS_NONLEAF_PMD_YOUNG
  1176. bool
  1177. help
  1178. Architectures that select this option are capable of setting the
  1179. accessed bit in non-leaf PMD entries when using them as part of linear
  1180. address translations. Page table walkers that clear the accessed bit
  1181. may use this capability to reduce their search space.
  1182. source "kernel/gcov/Kconfig"
  1183. source "scripts/gcc-plugins/Kconfig"
  1184. endmenu