Loading lib/Kconfig.debug +9 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,15 @@ config DYNAMIC_DEBUG See Documentation/admin-guide/dynamic-debug-howto.rst for additional information. config DEBUG_CONSOLE_UNHASHED_POINTERS bool "Display unhashed kernel pointers" depends on DEBUG_KERNEL help Pointers %p and %pK are normally hashed prior to being displayed to prevent leaking kernel addresses. On debug builds, always print actual pointer values, ignoring the kptr_restrict setting. Not to be enabled on production builds. endmenu # "printk and dmesg options" menu "Compile-time checks and compiler options" Loading lib/vsprintf.c +5 −0 Original line number Diff line number Diff line Loading @@ -2163,6 +2163,8 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, case 'V': return va_format(buf, end, ptr, spec, fmt); case 'K': if (IS_ENABLED(CONFIG_DEBUG_CONSOLE_UNHASHED_POINTERS)) break; return restricted_pointer(buf, end, ptr, spec); case 'N': return netdev_bits(buf, end, ptr, spec, fmt); Loading @@ -2189,6 +2191,9 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, return pointer_string(buf, end, ptr, spec); } if (IS_ENABLED(CONFIG_DEBUG_CONSOLE_UNHASHED_POINTERS)) return pointer_string(buf, end, ptr, spec); /* default is to _not_ leak addresses, hash before printing */ return ptr_to_id(buf, end, ptr, spec); } Loading Loading
lib/Kconfig.debug +9 −0 Original line number Diff line number Diff line Loading @@ -164,6 +164,15 @@ config DYNAMIC_DEBUG See Documentation/admin-guide/dynamic-debug-howto.rst for additional information. config DEBUG_CONSOLE_UNHASHED_POINTERS bool "Display unhashed kernel pointers" depends on DEBUG_KERNEL help Pointers %p and %pK are normally hashed prior to being displayed to prevent leaking kernel addresses. On debug builds, always print actual pointer values, ignoring the kptr_restrict setting. Not to be enabled on production builds. endmenu # "printk and dmesg options" menu "Compile-time checks and compiler options" Loading
lib/vsprintf.c +5 −0 Original line number Diff line number Diff line Loading @@ -2163,6 +2163,8 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, case 'V': return va_format(buf, end, ptr, spec, fmt); case 'K': if (IS_ENABLED(CONFIG_DEBUG_CONSOLE_UNHASHED_POINTERS)) break; return restricted_pointer(buf, end, ptr, spec); case 'N': return netdev_bits(buf, end, ptr, spec, fmt); Loading @@ -2189,6 +2191,9 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr, return pointer_string(buf, end, ptr, spec); } if (IS_ENABLED(CONFIG_DEBUG_CONSOLE_UNHASHED_POINTERS)) return pointer_string(buf, end, ptr, spec); /* default is to _not_ leak addresses, hash before printing */ return ptr_to_id(buf, end, ptr, spec); } Loading