]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/early_printk: Harden early_serial
authorPeter Zijlstra <peterz@infradead.org>
Fri, 7 Feb 2025 12:15:38 +0000 (13:15 +0100)
committerPeter Zijlstra <peterz@infradead.org>
Fri, 14 Feb 2025 09:32:07 +0000 (10:32 +0100)
commit306859de59e59f88662b6b56ff2ce3bbb1e375bb
tree1e6ea5ab1fb74662acaf0655a44f7b45b7174c35
parentc4239a72a29d58a4377c2db8583c24f9e2b79d01
x86/early_printk: Harden early_serial

Scott found that mem32_serial_in() is an ideal speculation gadget, an
indirectly callable function that takes an adddress and offset and
immediately does a load.

Use static_call() to take away the need for indirect calls and
explicitly seal the functions to ensure they're not callable on IBT
enabled parts.

Reported-by: Scott Constable <scott.d.constable@intel.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Sami Tolvanen <samitolvanen@google.com>
Link: https://lore.kernel.org/r/20250207122546.919773202@infradead.org
arch/x86/kernel/early_printk.c