Kconfig.debug 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. menu "Kernel hacking"
  2. source "lib/Kconfig.debug"
  3. config ARM64_PTDUMP_CORE
  4. def_bool n
  5. config ARM64_PTDUMP_DEBUGFS
  6. bool "Export kernel pagetable layout to userspace via debugfs"
  7. depends on DEBUG_KERNEL
  8. select ARM64_PTDUMP_CORE
  9. select DEBUG_FS
  10. help
  11. Say Y here if you want to show the kernel pagetable layout in a
  12. debugfs file. This information is only useful for kernel developers
  13. who are working in architecture specific areas of the kernel.
  14. It is probably not a good idea to enable this feature in a production
  15. kernel.
  16. If in doubt, say N.
  17. config PID_IN_CONTEXTIDR
  18. bool "Write the current PID to the CONTEXTIDR register"
  19. help
  20. Enabling this option causes the kernel to write the current PID to
  21. the CONTEXTIDR register, at the expense of some additional
  22. instructions during context switch. Say Y here only if you are
  23. planning to use hardware trace tools with this kernel.
  24. config ARM64_RANDOMIZE_TEXT_OFFSET
  25. bool "Randomize TEXT_OFFSET at build time"
  26. help
  27. Say Y here if you want the image load offset (AKA TEXT_OFFSET)
  28. of the kernel to be randomized at build-time. When selected,
  29. this option will cause TEXT_OFFSET to be randomized upon any
  30. build of the kernel, and the offset will be reflected in the
  31. text_offset field of the resulting Image. This can be used to
  32. fuzz-test bootloaders which respect text_offset.
  33. This option is intended for bootloader and/or kernel testing
  34. only. Bootloaders must make no assumptions regarding the value
  35. of TEXT_OFFSET and platforms must not require a specific
  36. value.
  37. config DEBUG_WX
  38. bool "Warn on W+X mappings at boot"
  39. select ARM64_PTDUMP_CORE
  40. ---help---
  41. Generate a warning if any W+X mappings are found at boot.
  42. This is useful for discovering cases where the kernel is leaving
  43. W+X mappings after applying NX, as such mappings are a security risk.
  44. This check also includes UXN, which should be set on all kernel
  45. mappings.
  46. Look for a message in dmesg output like this:
  47. arm64/mm: Checked W+X mappings: passed, no W+X pages found.
  48. or like this, if the check failed:
  49. arm64/mm: Checked W+X mappings: FAILED, <N> W+X pages found.
  50. Note that even if the check fails, your kernel is possibly
  51. still fine, as W+X mappings are not a security hole in
  52. themselves, what they do is that they make the exploitation
  53. of other unfixed kernel bugs easier.
  54. There is no runtime or memory usage effect of this option
  55. once the kernel has booted up - it's a one time check.
  56. If in doubt, say "Y".
  57. config DEBUG_SET_MODULE_RONX
  58. bool "Set loadable kernel module data as NX and text as RO"
  59. depends on MODULES
  60. default y
  61. help
  62. Is this is set, kernel module text and rodata will be made read-only.
  63. This is to help catch accidental or malicious attempts to change the
  64. kernel's executable code.
  65. If in doubt, say Y.
  66. config DEBUG_ALIGN_RODATA
  67. depends on DEBUG_RODATA
  68. bool "Align linker sections up to SECTION_SIZE"
  69. help
  70. If this option is enabled, sections that may potentially be marked as
  71. read only or non-executable will be aligned up to the section size of
  72. the kernel. This prevents sections from being split into pages and
  73. avoids a potential TLB penalty. The downside is an increase in
  74. alignment and potentially wasted space. Turn on this option if
  75. performance is more important than memory pressure.
  76. If in doubt, say N.
  77. source "drivers/hwtracing/coresight/Kconfig"
  78. endmenu