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