lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 22 Apr 2022 22:13:12 +0900
From:   Masami Hiramatsu <mhiramat@...nel.org>
To:     kernel test robot <lkp@...el.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Ingo Molnar <mingo@...nel.org>, Sasha Levin <sashal@...nel.org>
Subject: Re: [linux-stable-rc:queue/4.19 3886/9999]
 arch/ia64/kernel/kprobes.c:414:24: error: implicit declaration of function
 '__kretprobe_trampoline_handler'; did you mean 'kretprobe_trampoline'?

Hi Greg,

Can you revert/drop this patch from 4.19 stable tree?
This patch is a part of bigger series, which introduces a generic
arch-independent kretprobe trampoline handler, but that is not for the
stable tree.

Also, the commit f5f96e3643dc33d6117cf7047e73512046e4858b is in the 4.19
stable tree, which fixes this commit. Thus that must be removed too.

Thank you,

On Wed, 13 Apr 2022 01:59:56 +0800
kernel test robot <lkp@...el.com> wrote:

> Hi Masami,
> 
> FYI, the error/warning still remains.
> 
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git queue/4.19
> head:   bdfbd5df0daf1748bef4501ce255ce594ee8d55f
> commit: d3380de483d55d904fb94a241406b34ed2fada7d [3886/9999] ia64: kprobes: Use generic kretprobe trampoline handler
> config: ia64-allyesconfig (https://download.01.org/0day-ci/archive/20220413/202204130102.JZPa6KCQ-lkp@intel.com/config)
> compiler: ia64-linux-gcc (GCC) 11.2.0
> reproduce (this is a W=1 build):
>         wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/commit/?id=d3380de483d55d904fb94a241406b34ed2fada7d
>         git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
>         git fetch --no-tags linux-stable-rc queue/4.19
>         git checkout d3380de483d55d904fb94a241406b34ed2fada7d
>         # save the config file to linux build tree
>         mkdir build_dir
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=ia64 SHELL=/bin/bash
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@...el.com>
> 
> All errors (new ones prefixed by >>):
> 
>    arch/ia64/kernel/kprobes.c: In function 'get_kprobe_inst':
>    arch/ia64/kernel/kprobes.c:338:22: warning: variable 'template' set but not used [-Wunused-but-set-variable]
>      338 |         unsigned int template;
>          |                      ^~~~~~~~
>    arch/ia64/kernel/kprobes.c: At top level:
>    arch/ia64/kernel/kprobes.c:412:15: warning: no previous prototype for 'trampoline_probe_handler' [-Wmissing-prototypes]
>      412 | int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
>          |               ^~~~~~~~~~~~~~~~~~~~~~~~
>    arch/ia64/kernel/kprobes.c: In function 'trampoline_probe_handler':
> >> arch/ia64/kernel/kprobes.c:414:24: error: implicit declaration of function '__kretprobe_trampoline_handler'; did you mean 'kretprobe_trampoline'? [-Werror=implicit-function-declaration]
>      414 |         regs->cr_iip = __kretprobe_trampoline_handler(regs, kretprobe_trampoline, NULL);
>          |                        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>          |                        kretprobe_trampoline
>    At top level:
>    arch/ia64/kernel/kprobes.c:928:13: warning: 'ia64_get_bsp_cfm' defined but not used [-Wunused-function]
>      928 | static void ia64_get_bsp_cfm(struct unw_frame_info *info, void *arg)
>          |             ^~~~~~~~~~~~~~~~
>    cc1: some warnings being treated as errors
> 
> Kconfig warnings: (for reference only)
>    WARNING: unmet direct dependencies detected for FRAME_POINTER
>    Depends on DEBUG_KERNEL && (M68K || UML || SUPERH) || ARCH_WANT_FRAME_POINTERS
>    Selected by
>    - FAULT_INJECTION_STACKTRACE_FILTER && FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT && !X86_64 && !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC && !X86
> 
> 
> vim +414 arch/ia64/kernel/kprobes.c
> 
>    333	
>    334	static void __kprobes get_kprobe_inst(bundle_t *bundle, uint slot,
>    335		       	unsigned long *kprobe_inst, uint *major_opcode)
>    336	{
>    337		unsigned long kprobe_inst_p0, kprobe_inst_p1;
>  > 338		unsigned int template;
>    339	
>    340		template = bundle->quad0.template;
>    341	
>    342		switch (slot) {
>    343		  case 0:
>    344			*major_opcode = (bundle->quad0.slot0 >> SLOT0_OPCODE_SHIFT);
>    345			*kprobe_inst = bundle->quad0.slot0;
>    346			  break;
>    347		  case 1:
>    348			*major_opcode = (bundle->quad1.slot1_p1 >> SLOT1_p1_OPCODE_SHIFT);
>    349			kprobe_inst_p0 = bundle->quad0.slot1_p0;
>    350			kprobe_inst_p1 = bundle->quad1.slot1_p1;
>    351			*kprobe_inst = kprobe_inst_p0 | (kprobe_inst_p1 << (64-46));
>    352			break;
>    353		  case 2:
>    354			*major_opcode = (bundle->quad1.slot2 >> SLOT2_OPCODE_SHIFT);
>    355			*kprobe_inst = bundle->quad1.slot2;
>    356			break;
>    357		}
>    358	}
>    359	
>    360	/* Returns non-zero if the addr is in the Interrupt Vector Table */
>    361	static int __kprobes in_ivt_functions(unsigned long addr)
>    362	{
>    363		return (addr >= (unsigned long)__start_ivt_text
>    364			&& addr < (unsigned long)__end_ivt_text);
>    365	}
>    366	
>    367	static int __kprobes valid_kprobe_addr(int template, int slot,
>    368					       unsigned long addr)
>    369	{
>    370		if ((slot > 2) || ((bundle_encoding[template][1] == L) && slot > 1)) {
>    371			printk(KERN_WARNING "Attempting to insert unaligned kprobe "
>    372					"at 0x%lx\n", addr);
>    373			return -EINVAL;
>    374		}
>    375	
>    376		if (in_ivt_functions(addr)) {
>    377			printk(KERN_WARNING "Kprobes can't be inserted inside "
>    378					"IVT functions at 0x%lx\n", addr);
>    379			return -EINVAL;
>    380		}
>    381	
>    382		return 0;
>    383	}
>    384	
>    385	static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb)
>    386	{
>    387		unsigned int i;
>    388		i = atomic_add_return(1, &kcb->prev_kprobe_index);
>    389		kcb->prev_kprobe[i-1].kp = kprobe_running();
>    390		kcb->prev_kprobe[i-1].status = kcb->kprobe_status;
>    391	}
>    392	
>    393	static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb)
>    394	{
>    395		unsigned int i;
>    396		i = atomic_read(&kcb->prev_kprobe_index);
>    397		__this_cpu_write(current_kprobe, kcb->prev_kprobe[i-1].kp);
>    398		kcb->kprobe_status = kcb->prev_kprobe[i-1].status;
>    399		atomic_sub(1, &kcb->prev_kprobe_index);
>    400	}
>    401	
>    402	static void __kprobes set_current_kprobe(struct kprobe *p,
>    403				struct kprobe_ctlblk *kcb)
>    404	{
>    405		__this_cpu_write(current_kprobe, p);
>    406	}
>    407	
>    408	static void kretprobe_trampoline(void)
>    409	{
>    410	}
>    411	
>    412	int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
>    413	{
>  > 414		regs->cr_iip = __kretprobe_trampoline_handler(regs, kretprobe_trampoline, NULL);
>    415		/*
>    416		 * By returning a non-zero value, we are telling
>    417		 * kprobe_handler() that we don't want the post_handler
>    418		 * to run (and have re-enabled preemption)
>    419		 */
>    420		return 1;
>    421	}
>    422	
> 
> -- 
> 0-DAY CI Kernel Test Service
> https://01.org/lkp


-- 
Masami Hiramatsu <mhiramat@...nel.org>

Powered by blists - more mailing lists