]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
x86/bug: Handle __WARN_printf() trap in early_fixup_exception()
authorHou Wenlong <houwenlong.hwl@antgroup.com>
Sat, 10 Jan 2026 03:47:37 +0000 (11:47 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 23 Feb 2026 10:19:11 +0000 (11:19 +0100)
commita0cb371b521dde44f32cfe954b6ef6f82b407393
tree5124177c0424bb57ba669317f2688e3319adc691
parentaa280a08e7d8fae58557acc345b36b3dc329d595
x86/bug: Handle __WARN_printf() trap in early_fixup_exception()

The commit 5b472b6e5bd9 ("x86_64/bug: Implement __WARN_printf()")
implemented __WARN_printf(), which changed the mechanism to use UD1
instead of UD2. However, it only handles the trap in the runtime IDT
handler, while the early booting IDT handler lacks this handling. As a
result, the usage of WARN() before the runtime IDT setup can lead to
kernel crashes. Since KMSAN is enabled after the runtime IDT setup, it
is safe to use handle_bug() directly in early_fixup_exception() to
address this issue.

Fixes: 5b472b6e5bd9 ("x86_64/bug: Implement __WARN_printf()")
Signed-off-by: Hou Wenlong <houwenlong.hwl@antgroup.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/c4fb3645f60d3a78629d9870e8fcc8535281c24f.1768016713.git.houwenlong.hwl@antgroup.com
arch/x86/include/asm/traps.h
arch/x86/kernel/traps.c
arch/x86/mm/extable.c