CC: [email protected] BCC: [email protected] CC: [email protected] TO: Peter Zijlstra <[email protected]> CC: Alexei Starovoitov <[email protected]> CC: Masami Hiramatsu <[email protected]>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 672c0c5173427e6b3e2a9bbb7be51ceeec78093a commit: 0ef6f5c09371f17e142814e6996d6dfb8741925b x86,rethook: Fix arch_rethook_trampoline() to generate a complete pt_regs date: 5 weeks ago :::::: branch date: 20 hours ago :::::: commit date: 5 weeks ago config: i386-randconfig-m031-20220502 (https://download.01.org/0day-ci/archive/20220503/[email protected]/config) compiler: gcc-11 (Debian 11.2.0-20) 11.2.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <[email protected]> Reported-by: Dan Carpenter <[email protected]> smatch warnings: arch/x86/kernel/rethook.c:92 arch_rethook_trampoline_callback() warn: potential memory corrupting cast 4 vs 2 bytes vim +92 arch/x86/kernel/rethook.c f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 63 f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 64 /* f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 65 * Called from arch_rethook_trampoline f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 66 */ f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 67 __used __visible void arch_rethook_trampoline_callback(struct pt_regs *regs) f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 68 { f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 69 unsigned long *frame_pointer; f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 70 f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 71 /* fixup registers */ f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 72 regs->cs = __KERNEL_CS; f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 73 #ifdef CONFIG_X86_32 f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 74 regs->gs = 0; f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 75 #endif f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 76 regs->ip = (unsigned long)&arch_rethook_trampoline; f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 77 regs->orig_ax = ~0UL; 0ef6f5c09371f17 Peter Zijlstra 2022-03-26 78 regs->sp += 2*sizeof(long); 0ef6f5c09371f17 Peter Zijlstra 2022-03-26 79 frame_pointer = (long *)(regs + 1); f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 80 f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 81 /* f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 82 * The return address at 'frame_pointer' is recovered by the f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 83 * arch_rethook_fixup_return() which called from this f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 84 * rethook_trampoline_handler(). f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 85 */ f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 86 rethook_trampoline_handler(regs, (unsigned long)frame_pointer); f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 87 f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 88 /* 0ef6f5c09371f17 Peter Zijlstra 2022-03-26 89 * Copy FLAGS to 'pt_regs::ss' so that arch_rethook_trapmoline() f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 90 * can do RET right after POPF. f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 91 */ 0ef6f5c09371f17 Peter Zijlstra 2022-03-26 @92 *(unsigned long *)®s->ss = regs->flags; f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 93 } f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 94 NOKPROBE_SYMBOL(arch_rethook_trampoline_callback); f3a112c0c40dd96 Masami Hiramatsu 2022-03-26 95 -- 0-DAY CI Kernel Test Service https://01.org/lkp _______________________________________________ kbuild mailing list -- [email protected] To unsubscribe send an email to [email protected]
