Kconfig 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. # SPDX-License-Identifier: GPL-2.0-only
  2. config HAVE_GCC_PLUGINS
  3. bool
  4. help
  5. An arch should select this symbol if it supports building with
  6. GCC plugins.
  7. menuconfig GCC_PLUGINS
  8. bool "GCC plugins"
  9. depends on HAVE_GCC_PLUGINS
  10. depends on CC_IS_GCC
  11. depends on $(success,test -e $(shell,$(CC) -print-file-name=plugin)/include/plugin-version.h)
  12. default y
  13. help
  14. GCC plugins are loadable modules that provide extra features to the
  15. compiler. They are useful for runtime instrumentation and static analysis.
  16. See Documentation/kbuild/gcc-plugins.rst for details.
  17. if GCC_PLUGINS
  18. config GCC_PLUGIN_CYC_COMPLEXITY
  19. bool "Compute the cyclomatic complexity of a function" if EXPERT
  20. depends on !COMPILE_TEST # too noisy
  21. help
  22. The complexity M of a function's control flow graph is defined as:
  23. M = E - N + 2P
  24. where
  25. E = the number of edges
  26. N = the number of nodes
  27. P = the number of connected components (exit nodes).
  28. Enabling this plugin reports the complexity to stderr during the
  29. build. It mainly serves as a simple example of how to create a
  30. gcc plugin for the kernel.
  31. config GCC_PLUGIN_SANCOV
  32. bool
  33. help
  34. This plugin inserts a __sanitizer_cov_trace_pc() call at the start of
  35. basic blocks. It supports all gcc versions with plugin support (from
  36. gcc-4.5 on). It is based on the commit "Add fuzzing coverage support"
  37. by Dmitry Vyukov <[email protected]>.
  38. config GCC_PLUGIN_LATENT_ENTROPY
  39. bool "Generate some entropy during boot and runtime"
  40. help
  41. By saying Y here the kernel will instrument some kernel code to
  42. extract some entropy from both original and artificially created
  43. program state. This will help especially embedded systems where
  44. there is little 'natural' source of entropy normally. The cost
  45. is some slowdown of the boot process (about 0.5%) and fork and
  46. irq processing.
  47. Note that entropy extracted this way is not cryptographically
  48. secure!
  49. This plugin was ported from grsecurity/PaX. More information at:
  50. * https://grsecurity.net/
  51. * https://pax.grsecurity.net/
  52. config GCC_PLUGIN_RANDSTRUCT
  53. bool "Randomize layout of sensitive kernel structures"
  54. select MODVERSIONS if MODULES
  55. help
  56. If you say Y here, the layouts of structures that are entirely
  57. function pointers (and have not been manually annotated with
  58. __no_randomize_layout), or structures that have been explicitly
  59. marked with __randomize_layout, will be randomized at compile-time.
  60. This can introduce the requirement of an additional information
  61. exposure vulnerability for exploits targeting these structure
  62. types.
  63. Enabling this feature will introduce some performance impact,
  64. slightly increase memory usage, and prevent the use of forensic
  65. tools like Volatility against the system (unless the kernel
  66. source tree isn't cleaned after kernel installation).
  67. The seed used for compilation is located at
  68. scripts/gcc-plugins/randomize_layout_seed.h. It remains after
  69. a make clean to allow for external modules to be compiled with
  70. the existing seed and will be removed by a make mrproper or
  71. make distclean.
  72. Note that the implementation requires gcc 4.7 or newer.
  73. This plugin was ported from grsecurity/PaX. More information at:
  74. * https://grsecurity.net/
  75. * https://pax.grsecurity.net/
  76. config GCC_PLUGIN_RANDSTRUCT_PERFORMANCE
  77. bool "Use cacheline-aware structure randomization"
  78. depends on GCC_PLUGIN_RANDSTRUCT
  79. depends on !COMPILE_TEST # do not reduce test coverage
  80. help
  81. If you say Y here, the RANDSTRUCT randomization will make a
  82. best effort at restricting randomization to cacheline-sized
  83. groups of elements. It will further not randomize bitfields
  84. in structures. This reduces the performance hit of RANDSTRUCT
  85. at the cost of weakened randomization.
  86. config GCC_PLUGIN_ARM_SSP_PER_TASK
  87. bool
  88. depends on GCC_PLUGINS && ARM
  89. endif