summaryrefslogtreecommitdiff
path: root/arch/x86/include/asm/bug.h
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2025-02-07 13:15:36 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-05-29 11:02:50 +0200
commit9c5f85b72fa6d285c91e7d867b4c3643a6952efb (patch)
tree36862ac76cad3519f025e676501c9e9cde2ce84e /arch/x86/include/asm/bug.h
parenteb6fd16b4fc4feb370c68ec17b59f6078f276a51 (diff)
x86/traps: Cleanup and robustify decode_bug()
[ Upstream commit c20ad96c9a8f0aeaf4e4057730a22de2657ad0c2 ] Notably, don't attempt to decode an immediate when MOD == 3. Additionally have it return the instruction length, such that WARN like bugs can more reliably skip to the correct instruction. Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Reviewed-by: Sami Tolvanen <samitolvanen@google.com> Link: https://lore.kernel.org/r/20250207122546.721120726@infradead.org Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/x86/include/asm/bug.h')
-rw-r--r--arch/x86/include/asm/bug.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h
index 806649c7f23d..9a0f29be1a9e 100644
--- a/arch/x86/include/asm/bug.h
+++ b/arch/x86/include/asm/bug.h
@@ -22,8 +22,9 @@
#define SECOND_BYTE_OPCODE_UD2 0x0b
#define BUG_NONE 0xffff
-#define BUG_UD1 0xfffe
-#define BUG_UD2 0xfffd
+#define BUG_UD2 0xfffe
+#define BUG_UD1 0xfffd
+#define BUG_UD1_UBSAN 0xfffc
#ifdef CONFIG_GENERIC_BUG