All of lore.kernel.org
 help / color / mirror / Atom feed
* arch/x86/kernel/rethook.c:92 arch_rethook_trampoline_callback() warn: potential memory corrupting cast 4 vs 2 bytes
@ 2022-05-02 17:12 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-05-02 17:12 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 3616 bytes --]

CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Peter Zijlstra <peterz@infradead.org>
CC: Alexei Starovoitov <ast@kernel.org>
CC: Masami Hiramatsu <mhiramat@kernel.org>

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/202205030130.Hu3m7xuS-lkp(a)intel.com/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 <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

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 *)&regs->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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-02 17:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-02 17:12 arch/x86/kernel/rethook.c:92 arch_rethook_trampoline_callback() warn: potential memory corrupting cast 4 vs 2 bytes kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.