Skip to contentSkip to conversation

bug: avoid Kconfig warning for BUG_ON_DATA_CORRUPTION

PATCH In review Arnd Bergmann 3 participants 3 messages Aug 26, 2016 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bug: avoid Kconfig warning for BUG_ON_DATA_CORRUPTION

The CONFIG_DEBUG_LIST option is normally meant for kernel developers rather than production machines and is guarded by CONFIG_DEBUG_KERNEL.

In contrast, the newly added CONFIG_BUG_ON_DATA_CORRUPTION is meant for security hardening and may be used on systems that intentionally do not enable CONFIG_DEBUG_KERNEL. In this configuration, we get a warning from Kconfig about the mismatched dependencies:

warning: (BUG_ON_DATA_CORRUPTION) selects DEBUG_LIST which has unmet direct dependencies (DEBUG_KERNEL)

This annotates the DEBUG_LIST option to be selectable by BUG_ON_DATA_CORRUPTION when DEBUG_KERNEL is disabled.

Fixes 40cd725cfc7f ("bug: Provide toggle for BUG on data corruption")
---
 lib/Kconfig.debug | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/Kconfig.debug +1 -1
index 6f5ca0530e47..dd40d4ad9063 100644
@@ -1229,7 +1229,7 @@ config DEBUG_BUGVERBOSE
 
 config DEBUG_LIST
 	bool "Debug linked list manipulation"
-	depends on DEBUG_KERNEL
+	depends on DEBUG_KERNEL || BUG_ON_DATA_CORRUPTION
 	help
 	  Enable this to turn on extended checks in the linked-list
 	  walking routines.
Signature · 1 line
2.9.0
Acked-by on v1 1/1
#1 lore raw
Quoted 12 lines · Arnd Bergmann

The CONFIG_DEBUG_LIST option is normally meant for kernel developers rather than production machines and is guarded by CONFIG_DEBUG_KERNEL.

In contrast, the newly added CONFIG_BUG_ON_DATA_CORRUPTION is meant for security hardening and may be used on systems that intentionally do not enable CONFIG_DEBUG_KERNEL. In this configuration, we get a warning from Kconfig about the mismatched dependencies:

warning: (BUG_ON_DATA_CORRUPTION) selects DEBUG_LIST which has unmet direct dependencies (DEBUG_KERNEL)

Quoted 7 lines

This annotates the DEBUG_LIST option to be selectable by BUG_ON_DATA_CORRUPTION when DEBUG_KERNEL is disabled.

Fixes 40cd725cfc7f ("bug: Provide toggle for BUG on data

corruption")

#2 lore raw
Quoted 13 lines · Rik van Riel
Quoted 12 lines · Arnd Bergmann

The CONFIG_DEBUG_LIST option is normally meant for kernel developers rather than production machines and is guarded by CONFIG_DEBUG_KERNEL.

In contrast, the newly added CONFIG_BUG_ON_DATA_CORRUPTION is meant for security hardening and may be used on systems that intentionally do not enable CONFIG_DEBUG_KERNEL. In this configuration, we get a warning from Kconfig about the mismatched dependencies:

warning: (BUG_ON_DATA_CORRUPTION) selects DEBUG_LIST which has unmet direct dependencies (DEBUG_KERNEL)

Quoted 8 lines
Quoted 7 lines

This annotates the DEBUG_LIST option to be selectable by BUG_ON_DATA_CORRUPTION when DEBUG_KERNEL is disabled.

Fixes 40cd725cfc7f ("bug: Provide toggle for BUG on data

corruption")

Queued for further review and testing, thank you both!

I expect to push this into the upcoming merge window, given that it fixes a bug in my current stack of commits.

Thanx, Paul