Skip to content

Commit

Permalink
lib/Kconfig.debug: fix some messed up configurations
Browse files Browse the repository at this point in the history
Some configuration items are messed up during conflict resolving.  For
example, STRICT_DEVMEM should not in testing menu, but kunit should.
This patch fixes all of them.

[akpm@linux-foundation.org: coding style fixes]
Link: http://lkml.kernel.org/r/20191209155653.7509-1-changbin.du@gmail.com
Signed-off-by: Changbin Du <changbin.du@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Changbin Du authored and Linus Torvalds committed Dec 18, 2019
1 parent 42a9a53 commit 045f6d7
Showing 1 changed file with 51 additions and 49 deletions.
100 changes: 51 additions & 49 deletions lib/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -1483,6 +1483,55 @@ config PROVIDE_OHCI1394_DMA_INIT

See Documentation/debugging-via-ohci1394.txt for more information.

source "samples/Kconfig"

config ARCH_HAS_DEVMEM_IS_ALLOWED
bool

config STRICT_DEVMEM
bool "Filter access to /dev/mem"
depends on MMU && DEVMEM
depends on ARCH_HAS_DEVMEM_IS_ALLOWED
default y if PPC || X86 || ARM64
help
If this option is disabled, you allow userspace (root) access to all
of memory, including kernel and userspace memory. Accidental
access to this is obviously disastrous, but specific access can
be used by people debugging the kernel. Note that with PAT support
enabled, even in this case there are restrictions on /dev/mem
use due to the cache aliasing requirements.

If this option is switched on, and IO_STRICT_DEVMEM=n, the /dev/mem
file only allows userspace access to PCI space and the BIOS code and
data regions. This is sufficient for dosemu and X and all common
users of /dev/mem.

If in doubt, say Y.

config IO_STRICT_DEVMEM
bool "Filter I/O access to /dev/mem"
depends on STRICT_DEVMEM
help
If this option is disabled, you allow userspace (root) access to all
io-memory regardless of whether a driver is actively using that
range. Accidental access to this is obviously disastrous, but
specific access can be used by people debugging kernel drivers.

If this option is switched on, the /dev/mem file only allows
userspace access to *idle* io-memory ranges (see /proc/iomem) This
may break traditional users of /dev/mem (dosemu, legacy X, etc...)
if the driver using a given range cannot be disabled.

If in doubt, say Y.

menu "$(SRCARCH) Debugging"

source "arch/$(SRCARCH)/Kconfig.debug"

endmenu

menu "Kernel Testing and Coverage"

source "lib/kunit/Kconfig"

config NOTIFIER_ERROR_INJECTION
Expand Down Expand Up @@ -1643,10 +1692,6 @@ config FAULT_INJECTION_STACKTRACE_FILTER
help
Provide stacktrace filter for fault-injection capabilities

endmenu # "Kernel Testing and Coverage"

menu "Kernel Testing and Coverage"

config ARCH_HAS_KCOV
bool
help
Expand Down Expand Up @@ -2130,52 +2175,7 @@ config MEMTEST
memtest=17, mean do 17 test patterns.
If you are unsure how to answer this question, answer N.

source "samples/Kconfig"

config ARCH_HAS_DEVMEM_IS_ALLOWED
bool

config STRICT_DEVMEM
bool "Filter access to /dev/mem"
depends on MMU && DEVMEM
depends on ARCH_HAS_DEVMEM_IS_ALLOWED
default y if PPC || X86 || ARM64
---help---
If this option is disabled, you allow userspace (root) access to all
of memory, including kernel and userspace memory. Accidental
access to this is obviously disastrous, but specific access can
be used by people debugging the kernel. Note that with PAT support
enabled, even in this case there are restrictions on /dev/mem
use due to the cache aliasing requirements.

If this option is switched on, and IO_STRICT_DEVMEM=n, the /dev/mem
file only allows userspace access to PCI space and the BIOS code and
data regions. This is sufficient for dosemu and X and all common
users of /dev/mem.

If in doubt, say Y.

config IO_STRICT_DEVMEM
bool "Filter I/O access to /dev/mem"
depends on STRICT_DEVMEM
---help---
If this option is disabled, you allow userspace (root) access to all
io-memory regardless of whether a driver is actively using that
range. Accidental access to this is obviously disastrous, but
specific access can be used by people debugging kernel drivers.

If this option is switched on, the /dev/mem file only allows
userspace access to *idle* io-memory ranges (see /proc/iomem) This
may break traditional users of /dev/mem (dosemu, legacy X, etc...)
if the driver using a given range cannot be disabled.

If in doubt, say Y.

menu "$(SRCARCH) Debugging"

source "arch/$(SRCARCH)/Kconfig.debug"

endmenu

config HYPERV_TESTING
bool "Microsoft Hyper-V driver testing"
Expand All @@ -2184,4 +2184,6 @@ config HYPERV_TESTING
help
Select this option to enable Hyper-V vmbus testing.

endmenu # "Kernel Testing and Coverage"

endmenu # Kernel hacking

0 comments on commit 045f6d7

Please sign in to comment.