Kconfig.debug 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. menu "Kernel hacking"
  2. source "lib/Kconfig.debug"
  3. config ARM64_PTDUMP
  4. bool "Export kernel pagetable layout to userspace via debugfs"
  5. depends on DEBUG_KERNEL
  6. select DEBUG_FS
  7. help
  8. Say Y here if you want to show the kernel pagetable layout in a
  9. debugfs file. This information is only useful for kernel developers
  10. who are working in architecture specific areas of the kernel.
  11. It is probably not a good idea to enable this feature in a production
  12. kernel.
  13. If in doubt, say "N"
  14. config STRICT_DEVMEM
  15. bool "Filter access to /dev/mem"
  16. depends on MMU
  17. help
  18. If this option is disabled, you allow userspace (root) access to all
  19. of memory, including kernel and userspace memory. Accidental
  20. access to this is obviously disastrous, but specific access can
  21. be used by people debugging the kernel.
  22. If this option is switched on, the /dev/mem file only allows
  23. userspace access to memory mapped peripherals.
  24. If in doubt, say Y.
  25. config PID_IN_CONTEXTIDR
  26. bool "Write the current PID to the CONTEXTIDR register"
  27. help
  28. Enabling this option causes the kernel to write the current PID to
  29. the CONTEXTIDR register, at the expense of some additional
  30. instructions during context switch. Say Y here only if you are
  31. planning to use hardware trace tools with this kernel.
  32. config ARM64_RANDOMIZE_TEXT_OFFSET
  33. bool "Randomize TEXT_OFFSET at build time"
  34. help
  35. Say Y here if you want the image load offset (AKA TEXT_OFFSET)
  36. of the kernel to be randomized at build-time. When selected,
  37. this option will cause TEXT_OFFSET to be randomized upon any
  38. build of the kernel, and the offset will be reflected in the
  39. text_offset field of the resulting Image. This can be used to
  40. fuzz-test bootloaders which respect text_offset.
  41. This option is intended for bootloader and/or kernel testing
  42. only. Bootloaders must make no assumptions regarding the value
  43. of TEXT_OFFSET and platforms must not require a specific
  44. value.
  45. config DEBUG_SET_MODULE_RONX
  46. bool "Set loadable kernel module data as NX and text as RO"
  47. depends on MODULES
  48. help
  49. This option helps catch unintended modifications to loadable
  50. kernel module's text and read-only data. It also prevents execution
  51. of module data. Such protection may interfere with run-time code
  52. patching and dynamic kernel tracing - and they might also protect
  53. against certain classes of kernel exploits.
  54. If in doubt, say "N".
  55. config DEBUG_RODATA
  56. bool "Make kernel text and rodata read-only"
  57. help
  58. If this is set, kernel text and rodata will be made read-only. This
  59. is to help catch accidental or malicious attempts to change the
  60. kernel's executable code. Additionally splits rodata from kernel
  61. text so it can be made explicitly non-executable.
  62. If in doubt, say Y
  63. config DEBUG_ALIGN_RODATA
  64. depends on DEBUG_RODATA && ARM64_4K_PAGES
  65. bool "Align linker sections up to SECTION_SIZE"
  66. help
  67. If this option is enabled, sections that may potentially be marked as
  68. read only or non-executable will be aligned up to the section size of
  69. the kernel. This prevents sections from being split into pages and
  70. avoids a potential TLB penalty. The downside is an increase in
  71. alignment and potentially wasted space. Turn on this option if
  72. performance is more important than memory pressure.
  73. If in doubt, say N
  74. source "drivers/hwtracing/coresight/Kconfig"
  75. endmenu