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>] [day] [month] [year] [list]
Message-ID: <202505151341.EuRFR22l-lkp@intel.com>
Date: Thu, 15 May 2025 22:05:06 +0800
From: kernel test robot <lkp@...el.com>
To: "Mike Rapoport (IBM)" <rppt@...nel.org>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
	Luis Chamberlain <mcgrof@...nel.org>
Subject: arch/sh/kernel/kprobes.c:412:24: warning: variable 'p' set but not
 used

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   9f35e33144ae5377d6a8de86dd3bd4d995c6ac65
commit: 7582b7be16d0ba90e3dbd9575a730cabd9eb852a kprobes: remove dependency on CONFIG_MODULES
date:   1 year ago
config: sh-randconfig-2003-20250513 (https://download.01.org/0day-ci/archive/20250515/202505151341.EuRFR22l-lkp@intel.com/config)
compiler: sh4-linux-gcc (GCC) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250515/202505151341.EuRFR22l-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202505151341.EuRFR22l-lkp@intel.com/

All warnings (new ones prefixed by >>):

   arch/sh/kernel/kprobes.c:52:16: warning: no previous prototype for 'arch_copy_kprobe' [-Wmissing-prototypes]
      52 | void __kprobes arch_copy_kprobe(struct kprobe *p)
         |                ^~~~~~~~~~~~~~~~
   arch/sh/kernel/kprobes.c:304:15: warning: no previous prototype for 'trampoline_probe_handler' [-Wmissing-prototypes]
     304 | int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
         |               ^~~~~~~~~~~~~~~~~~~~~~~~
   arch/sh/kernel/kprobes.c: In function 'kprobe_exceptions_notify':
>> arch/sh/kernel/kprobes.c:412:24: warning: variable 'p' set but not used [-Wunused-but-set-variable]
     412 |         struct kprobe *p = NULL;
         |                        ^


vim +/p +412 arch/sh/kernel/kprobes.c

d39f5450146ff3 Chris Smith      2008-09-05  405  
d39f5450146ff3 Chris Smith      2008-09-05  406  /*
d39f5450146ff3 Chris Smith      2008-09-05  407   * Wrapper routine to for handling exceptions.
d39f5450146ff3 Chris Smith      2008-09-05  408   */
d39f5450146ff3 Chris Smith      2008-09-05  409  int __kprobes kprobe_exceptions_notify(struct notifier_block *self,
d39f5450146ff3 Chris Smith      2008-09-05  410  				       unsigned long val, void *data)
d39f5450146ff3 Chris Smith      2008-09-05  411  {
d39f5450146ff3 Chris Smith      2008-09-05 @412  	struct kprobe *p = NULL;
d39f5450146ff3 Chris Smith      2008-09-05  413  	struct die_args *args = (struct die_args *)data;
d39f5450146ff3 Chris Smith      2008-09-05  414  	int ret = NOTIFY_DONE;
d39f5450146ff3 Chris Smith      2008-09-05  415  	kprobe_opcode_t *addr = NULL;
d39f5450146ff3 Chris Smith      2008-09-05  416  	struct kprobe_ctlblk *kcb = get_kprobe_ctlblk();
d39f5450146ff3 Chris Smith      2008-09-05  417  
d39f5450146ff3 Chris Smith      2008-09-05  418  	addr = (kprobe_opcode_t *) (args->regs->pc);
d3023897b4370b Michael Karcher  2019-06-12  419  	if (val == DIE_TRAP &&
d3023897b4370b Michael Karcher  2019-06-12  420  	    args->trapnr == (BREAKPOINT_INSTRUCTION & 0xff)) {
d39f5450146ff3 Chris Smith      2008-09-05  421  		if (!kprobe_running()) {
d39f5450146ff3 Chris Smith      2008-09-05  422  			if (kprobe_handler(args->regs)) {
d39f5450146ff3 Chris Smith      2008-09-05  423  				ret = NOTIFY_STOP;
d39f5450146ff3 Chris Smith      2008-09-05  424  			} else {
d39f5450146ff3 Chris Smith      2008-09-05  425  				/* Not a kprobe trap */
ee386de77419f9 Paul Mundt       2008-09-08  426  				ret = NOTIFY_DONE;
d39f5450146ff3 Chris Smith      2008-09-05  427  			}
d39f5450146ff3 Chris Smith      2008-09-05  428  		} else {
d39f5450146ff3 Chris Smith      2008-09-05  429  			p = get_kprobe(addr);
d39f5450146ff3 Chris Smith      2008-09-05  430  			if ((kcb->kprobe_status == KPROBE_HIT_SS) ||
d39f5450146ff3 Chris Smith      2008-09-05  431  			    (kcb->kprobe_status == KPROBE_REENTER)) {
d39f5450146ff3 Chris Smith      2008-09-05  432  				if (post_kprobe_handler(args->regs))
d39f5450146ff3 Chris Smith      2008-09-05  433  					ret = NOTIFY_STOP;
d39f5450146ff3 Chris Smith      2008-09-05  434  			} else {
fa5a24b16f9441 Masami Hiramatsu 2018-06-20  435  				if (kprobe_handler(args->regs))
d39f5450146ff3 Chris Smith      2008-09-05  436  					ret = NOTIFY_STOP;
d39f5450146ff3 Chris Smith      2008-09-05  437  			}
d39f5450146ff3 Chris Smith      2008-09-05  438  		}
d39f5450146ff3 Chris Smith      2008-09-05  439  	}
d39f5450146ff3 Chris Smith      2008-09-05  440  
d39f5450146ff3 Chris Smith      2008-09-05  441  	return ret;
d39f5450146ff3 Chris Smith      2008-09-05  442  }
d39f5450146ff3 Chris Smith      2008-09-05  443  

:::::: The code at line 412 was first introduced by commit
:::::: d39f5450146ff39f66cfde9d5184420627d0ac51 sh: Add kprobes support.

:::::: TO: Chris Smith <chris.smith@...com>
:::::: CC: Paul Mundt <lethal@...ux-sh.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ