]> Gentwo Git Trees - linux/.git/commit
x86/bug: Fix BUG_FORMAT vs KASLR
authorPeter Zijlstra <peterz@infradead.org>
Wed, 26 Nov 2025 09:55:17 +0000 (10:55 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Thu, 27 Nov 2025 08:32:47 +0000 (09:32 +0100)
commitd62e4f2b9542d25d183f068033558e87e81a00a8
tree5c44911816cba32ed0a96bc0282f1ca650c75b87
parent860238af7a3348225de228dc0f33a7d631638333
x86/bug: Fix BUG_FORMAT vs KASLR

Encoding a relative NULL pointer doesn't work for KASLR, when the
whole kernel image gets shifted, the __bug_table and the target string
get shifted by the same amount and the relative offset is preserved.

However when the target is an absolute 0 value and the __bug_table
gets moved about, the end result in a pointer equivalent to
kaslr_offset(), not NULL.

Notably, this will generate SHN_UNDEF relocations, and Ard would
really like to not have those at all.

Use the empty string to denote no-string.

Suggested-by: Linus Torvalds <torvalds@linuxfoundation.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
arch/x86/include/asm/bug.h
lib/bug.c