Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'x86-core-2025-12-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull core x86 updates from Ingo Molnar:

- x86/alternatives: Drop unnecessary test after call to
alt_replace_call() (Juergen Gross)

- x86/dumpstack: Prevent KASAN false positive warnings in
__show_regs() (Tengda Wu)

* tag 'x86-core-2025-12-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/dumpstack: Prevent KASAN false positive warnings in __show_regs()
x86/alternative: Drop not needed test after call of alt_replace_call()

+24 -8
+3 -6
arch/x86/kernel/alternative.c
··· 541 541 * Rewrite the "call BUG_func" replacement to point to the target of the 542 542 * indirect pv_ops call "call *disp(%ip)". 543 543 */ 544 - static int alt_replace_call(u8 *instr, u8 *insn_buff, struct alt_instr *a) 544 + static unsigned int alt_replace_call(u8 *instr, u8 *insn_buff, struct alt_instr *a) 545 545 { 546 546 void *target, *bug = &BUG_func; 547 547 s32 disp; ··· 625 625 * order. 626 626 */ 627 627 for (a = start; a < end; a++) { 628 - int insn_buff_sz = 0; 628 + unsigned int insn_buff_sz = 0; 629 629 630 630 /* 631 631 * In case of nested ALTERNATIVE()s the outer alternative might ··· 665 665 memcpy(insn_buff, replacement, a->replacementlen); 666 666 insn_buff_sz = a->replacementlen; 667 667 668 - if (a->flags & ALT_FLAG_DIRECT_CALL) { 668 + if (a->flags & ALT_FLAG_DIRECT_CALL) 669 669 insn_buff_sz = alt_replace_call(instr, insn_buff, a); 670 - if (insn_buff_sz < 0) 671 - continue; 672 - } 673 670 674 671 for (; insn_buff_sz < a->instrlen; insn_buff_sz++) 675 672 insn_buff[insn_buff_sz] = 0x90;
+21 -2
arch/x86/kernel/dumpstack.c
··· 181 181 * in false positive reports. Disable instrumentation to avoid those. 182 182 */ 183 183 __no_kmsan_checks 184 - static void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs, 185 - unsigned long *stack, const char *log_lvl) 184 + static void __show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs, 185 + unsigned long *stack, const char *log_lvl) 186 186 { 187 187 struct unwind_state state; 188 188 struct stack_info stack_info = {0}; ··· 301 301 if (stack_name) 302 302 printk("%s </%s>\n", log_lvl, stack_name); 303 303 } 304 + } 305 + 306 + static void show_trace_log_lvl(struct task_struct *task, struct pt_regs *regs, 307 + unsigned long *stack, const char *log_lvl) 308 + { 309 + /* 310 + * Disable KASAN to avoid false positives during walking another 311 + * task's stacks, as values on these stacks may change concurrently 312 + * with task execution. 313 + */ 314 + bool disable_kasan = task && task != current; 315 + 316 + if (disable_kasan) 317 + kasan_disable_current(); 318 + 319 + __show_trace_log_lvl(task, regs, stack, log_lvl); 320 + 321 + if (disable_kasan) 322 + kasan_enable_current(); 304 323 } 305 324 306 325 void show_stack(struct task_struct *task, unsigned long *sp,