File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,38 @@ config DEBUG_RODATA_TEST
118
118
---help---
119
119
This option enables a testcase for the setting rodata read-only.
120
120
121
+ config ARCH_HAS_DEBUG_WX
122
+ bool
123
+
124
+ config DEBUG_WX
125
+ bool "Warn on W+X mappings at boot"
126
+ depends on ARCH_HAS_DEBUG_WX
127
+ depends on MMU
128
+ select PTDUMP_CORE
129
+ help
130
+ Generate a warning if any W+X mappings are found at boot.
131
+
132
+ This is useful for discovering cases where the kernel is leaving W+X
133
+ mappings after applying NX, as such mappings are a security risk.
134
+
135
+ Look for a message in dmesg output like this:
136
+
137
+ <arch>/mm: Checked W+X mappings: passed, no W+X pages found.
138
+
139
+ or like this, if the check failed:
140
+
141
+ <arch>/mm: Checked W+X mappings: failed, <N> W+X pages found.
142
+
143
+ Note that even if the check fails, your kernel is possibly
144
+ still fine, as W+X mappings are not a security hole in
145
+ themselves, what they do is that they make the exploitation
146
+ of other unfixed kernel bugs easier.
147
+
148
+ There is no runtime or memory usage effect of this option
149
+ once the kernel has booted up - it's a one time check.
150
+
151
+ If in doubt, say "Y".
152
+
121
153
config GENERIC_PTDUMP
122
154
bool
123
155
You can’t perform that action at this time.
0 commit comments