@@ -1483,6 +1483,55 @@ config PROVIDE_OHCI1394_DMA_INIT
1483
1483
1484
1484
See Documentation/debugging-via-ohci1394.txt for more information.
1485
1485
1486
+ source "samples/Kconfig"
1487
+
1488
+ config ARCH_HAS_DEVMEM_IS_ALLOWED
1489
+ bool
1490
+
1491
+ config STRICT_DEVMEM
1492
+ bool "Filter access to /dev/mem"
1493
+ depends on MMU && DEVMEM
1494
+ depends on ARCH_HAS_DEVMEM_IS_ALLOWED
1495
+ default y if PPC || X86 || ARM64
1496
+ help
1497
+ If this option is disabled, you allow userspace (root) access to all
1498
+ of memory, including kernel and userspace memory. Accidental
1499
+ access to this is obviously disastrous, but specific access can
1500
+ be used by people debugging the kernel. Note that with PAT support
1501
+ enabled, even in this case there are restrictions on /dev/mem
1502
+ use due to the cache aliasing requirements.
1503
+
1504
+ If this option is switched on, and IO_STRICT_DEVMEM=n, the /dev/mem
1505
+ file only allows userspace access to PCI space and the BIOS code and
1506
+ data regions. This is sufficient for dosemu and X and all common
1507
+ users of /dev/mem.
1508
+
1509
+ If in doubt, say Y.
1510
+
1511
+ config IO_STRICT_DEVMEM
1512
+ bool "Filter I/O access to /dev/mem"
1513
+ depends on STRICT_DEVMEM
1514
+ help
1515
+ If this option is disabled, you allow userspace (root) access to all
1516
+ io-memory regardless of whether a driver is actively using that
1517
+ range. Accidental access to this is obviously disastrous, but
1518
+ specific access can be used by people debugging kernel drivers.
1519
+
1520
+ If this option is switched on, the /dev/mem file only allows
1521
+ userspace access to *idle* io-memory ranges (see /proc/iomem) This
1522
+ may break traditional users of /dev/mem (dosemu, legacy X, etc...)
1523
+ if the driver using a given range cannot be disabled.
1524
+
1525
+ If in doubt, say Y.
1526
+
1527
+ menu "$(SRCARCH) Debugging"
1528
+
1529
+ source "arch/$(SRCARCH)/Kconfig.debug"
1530
+
1531
+ endmenu
1532
+
1533
+ menu "Kernel Testing and Coverage"
1534
+
1486
1535
source "lib/kunit/Kconfig"
1487
1536
1488
1537
config NOTIFIER_ERROR_INJECTION
@@ -1643,10 +1692,6 @@ config FAULT_INJECTION_STACKTRACE_FILTER
1643
1692
help
1644
1693
Provide stacktrace filter for fault-injection capabilities
1645
1694
1646
- endmenu # "Kernel Testing and Coverage"
1647
-
1648
- menu "Kernel Testing and Coverage"
1649
-
1650
1695
config ARCH_HAS_KCOV
1651
1696
bool
1652
1697
help
@@ -2130,52 +2175,7 @@ config MEMTEST
2130
2175
memtest=17, mean do 17 test patterns.
2131
2176
If you are unsure how to answer this question, answer N.
2132
2177
2133
- source "samples/Kconfig"
2134
-
2135
- config ARCH_HAS_DEVMEM_IS_ALLOWED
2136
- bool
2137
-
2138
- config STRICT_DEVMEM
2139
- bool "Filter access to /dev/mem"
2140
- depends on MMU && DEVMEM
2141
- depends on ARCH_HAS_DEVMEM_IS_ALLOWED
2142
- default y if PPC || X86 || ARM64
2143
- ---help---
2144
- If this option is disabled, you allow userspace (root) access to all
2145
- of memory, including kernel and userspace memory. Accidental
2146
- access to this is obviously disastrous, but specific access can
2147
- be used by people debugging the kernel. Note that with PAT support
2148
- enabled, even in this case there are restrictions on /dev/mem
2149
- use due to the cache aliasing requirements.
2150
-
2151
- If this option is switched on, and IO_STRICT_DEVMEM=n, the /dev/mem
2152
- file only allows userspace access to PCI space and the BIOS code and
2153
- data regions. This is sufficient for dosemu and X and all common
2154
- users of /dev/mem.
2155
-
2156
- If in doubt, say Y.
2157
2178
2158
- config IO_STRICT_DEVMEM
2159
- bool "Filter I/O access to /dev/mem"
2160
- depends on STRICT_DEVMEM
2161
- ---help---
2162
- If this option is disabled, you allow userspace (root) access to all
2163
- io-memory regardless of whether a driver is actively using that
2164
- range. Accidental access to this is obviously disastrous, but
2165
- specific access can be used by people debugging kernel drivers.
2166
-
2167
- If this option is switched on, the /dev/mem file only allows
2168
- userspace access to *idle* io-memory ranges (see /proc/iomem) This
2169
- may break traditional users of /dev/mem (dosemu, legacy X, etc...)
2170
- if the driver using a given range cannot be disabled.
2171
-
2172
- If in doubt, say Y.
2173
-
2174
- menu "$(SRCARCH) Debugging"
2175
-
2176
- source "arch/$(SRCARCH)/Kconfig.debug"
2177
-
2178
- endmenu
2179
2179
2180
2180
config HYPERV_TESTING
2181
2181
bool "Microsoft Hyper-V driver testing"
@@ -2184,4 +2184,6 @@ config HYPERV_TESTING
2184
2184
help
2185
2185
Select this option to enable Hyper-V vmbus testing.
2186
2186
2187
+ endmenu # "Kernel Testing and Coverage"
2188
+
2187
2189
endmenu # Kernel hacking
0 commit comments