All of lore.kernel.org
 help / color / mirror / Atom feed
* [peterz-queue:perf/core 21/21] kernel/events/uprobes.c:718 hprobe_consume() error: uninitialized symbol 'state'.
@ 2024-10-30 12:15 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2024-10-30 12:15 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Andrii Nakryiko <andrii@kernel.org>
CC: Peter Zijlstra <peterz@infradead.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git perf/core
head:   72a27524a4939fc0958796a46b51c1fab3729367
commit: 72a27524a4939fc0958796a46b51c1fab3729367 [21/21] uprobes: SRCU-protect uretprobe lifetime (with timeout)
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: i386-randconfig-141-20241030 (https://download.01.org/0day-ci/archive/20241030/202410302020.1jHBLfss-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

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@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202410302020.1jHBLfss-lkp@intel.com/

smatch warnings:
kernel/events/uprobes.c:718 hprobe_consume() error: uninitialized symbol 'state'.

vim +/state +718 kernel/events/uprobes.c

72a27524a4939f Andrii Nakryiko 2024-10-23  695  
72a27524a4939f Andrii Nakryiko 2024-10-23  696  /*
72a27524a4939f Andrii Nakryiko 2024-10-23  697   * hprobe_consume() fetches hprobe's underlying uprobe and detects whether
72a27524a4939f Andrii Nakryiko 2024-10-23  698   * uprobe is SRCU protected or is refcounted. hprobe_consume() can be
72a27524a4939f Andrii Nakryiko 2024-10-23  699   * used only once for a given hprobe.
72a27524a4939f Andrii Nakryiko 2024-10-23  700   *
72a27524a4939f Andrii Nakryiko 2024-10-23  701   * Caller has to call hprobe_finalize() and pass previous hprobe_state, so
72a27524a4939f Andrii Nakryiko 2024-10-23  702   * that hprobe_finalize() can perform SRCU unlock or put uprobe, whichever
72a27524a4939f Andrii Nakryiko 2024-10-23  703   * is appropriate.
72a27524a4939f Andrii Nakryiko 2024-10-23  704   */
72a27524a4939f Andrii Nakryiko 2024-10-23  705  static inline struct uprobe *hprobe_consume(struct hprobe *hprobe, enum hprobe_state *hstate)
72a27524a4939f Andrii Nakryiko 2024-10-23  706  {
72a27524a4939f Andrii Nakryiko 2024-10-23  707  	enum hprobe_state state;
72a27524a4939f Andrii Nakryiko 2024-10-23  708  
72a27524a4939f Andrii Nakryiko 2024-10-23  709  	*hstate = xchg(&hprobe->state, HPROBE_CONSUMED);
72a27524a4939f Andrii Nakryiko 2024-10-23  710  	switch (*hstate) {
72a27524a4939f Andrii Nakryiko 2024-10-23  711  	case HPROBE_LEASED:
72a27524a4939f Andrii Nakryiko 2024-10-23  712  	case HPROBE_STABLE:
72a27524a4939f Andrii Nakryiko 2024-10-23  713  		return hprobe->uprobe;
72a27524a4939f Andrii Nakryiko 2024-10-23  714  	case HPROBE_GONE:	/* uprobe is NULL, no SRCU */
72a27524a4939f Andrii Nakryiko 2024-10-23  715  	case HPROBE_CONSUMED:	/* uprobe was finalized already, do nothing */
72a27524a4939f Andrii Nakryiko 2024-10-23  716  		return NULL;
72a27524a4939f Andrii Nakryiko 2024-10-23  717  	default:
72a27524a4939f Andrii Nakryiko 2024-10-23 @718  		WARN(1, "hprobe invalid state %d", state);
72a27524a4939f Andrii Nakryiko 2024-10-23  719  		return NULL;
72a27524a4939f Andrii Nakryiko 2024-10-23  720  	}
72a27524a4939f Andrii Nakryiko 2024-10-23  721  }
72a27524a4939f Andrii Nakryiko 2024-10-23  722  

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [peterz-queue:perf/core 21/21] kernel/events/uprobes.c:718 hprobe_consume() error: uninitialized symbol 'state'.
@ 2024-10-30 12:49 Dan Carpenter
  2024-10-30 15:53 ` Andrii Nakryiko
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2024-10-30 12:49 UTC (permalink / raw)
  To: oe-kbuild, Andrii Nakryiko; +Cc: lkp, oe-kbuild-all, Peter Zijlstra

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git perf/core
head:   72a27524a4939fc0958796a46b51c1fab3729367
commit: 72a27524a4939fc0958796a46b51c1fab3729367 [21/21] uprobes: SRCU-protect uretprobe lifetime (with timeout)
config: i386-randconfig-141-20241030 (https://download.01.org/0day-ci/archive/20241030/202410302020.1jHBLfss-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0

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@intel.com>
| Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202410302020.1jHBLfss-lkp@intel.com/

smatch warnings:
kernel/events/uprobes.c:718 hprobe_consume() error: uninitialized symbol 'state'.

vim +/state +718 kernel/events/uprobes.c

72a27524a4939f Andrii Nakryiko 2024-10-23  705  static inline struct uprobe *hprobe_consume(struct hprobe *hprobe, enum hprobe_state *hstate)
72a27524a4939f Andrii Nakryiko 2024-10-23  706  {
72a27524a4939f Andrii Nakryiko 2024-10-23  707  	enum hprobe_state state;
72a27524a4939f Andrii Nakryiko 2024-10-23  708  
72a27524a4939f Andrii Nakryiko 2024-10-23  709  	*hstate = xchg(&hprobe->state, HPROBE_CONSUMED);
72a27524a4939f Andrii Nakryiko 2024-10-23  710  	switch (*hstate) {
72a27524a4939f Andrii Nakryiko 2024-10-23  711  	case HPROBE_LEASED:
72a27524a4939f Andrii Nakryiko 2024-10-23  712  	case HPROBE_STABLE:
72a27524a4939f Andrii Nakryiko 2024-10-23  713  		return hprobe->uprobe;
72a27524a4939f Andrii Nakryiko 2024-10-23  714  	case HPROBE_GONE:	/* uprobe is NULL, no SRCU */
72a27524a4939f Andrii Nakryiko 2024-10-23  715  	case HPROBE_CONSUMED:	/* uprobe was finalized already, do nothing */
72a27524a4939f Andrii Nakryiko 2024-10-23  716  		return NULL;
72a27524a4939f Andrii Nakryiko 2024-10-23  717  	default:
72a27524a4939f Andrii Nakryiko 2024-10-23 @718  		WARN(1, "hprobe invalid state %d", state);

s/state/*hstate/?

72a27524a4939f Andrii Nakryiko 2024-10-23  719  		return NULL;
72a27524a4939f Andrii Nakryiko 2024-10-23  720  	}
72a27524a4939f Andrii Nakryiko 2024-10-23  721  }

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [peterz-queue:perf/core 21/21] kernel/events/uprobes.c:718 hprobe_consume() error: uninitialized symbol 'state'.
  2024-10-30 12:49 Dan Carpenter
@ 2024-10-30 15:53 ` Andrii Nakryiko
  0 siblings, 0 replies; 3+ messages in thread
From: Andrii Nakryiko @ 2024-10-30 15:53 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: oe-kbuild, Andrii Nakryiko, lkp, oe-kbuild-all, Peter Zijlstra

On Wed, Oct 30, 2024 at 5:49 AM Dan Carpenter <dan.carpenter@linaro.org> wrote:
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git perf/core
> head:   72a27524a4939fc0958796a46b51c1fab3729367
> commit: 72a27524a4939fc0958796a46b51c1fab3729367 [21/21] uprobes: SRCU-protect uretprobe lifetime (with timeout)
> config: i386-randconfig-141-20241030 (https://download.01.org/0day-ci/archive/20241030/202410302020.1jHBLfss-lkp@intel.com/config)
> compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
>
> 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@intel.com>
> | Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> | Closes: https://lore.kernel.org/r/202410302020.1jHBLfss-lkp@intel.com/
>
> smatch warnings:
> kernel/events/uprobes.c:718 hprobe_consume() error: uninitialized symbol 'state'.
>
> vim +/state +718 kernel/events/uprobes.c
>
> 72a27524a4939f Andrii Nakryiko 2024-10-23  705  static inline struct uprobe *hprobe_consume(struct hprobe *hprobe, enum hprobe_state *hstate)
> 72a27524a4939f Andrii Nakryiko 2024-10-23  706  {
> 72a27524a4939f Andrii Nakryiko 2024-10-23  707          enum hprobe_state state;
> 72a27524a4939f Andrii Nakryiko 2024-10-23  708
> 72a27524a4939f Andrii Nakryiko 2024-10-23  709          *hstate = xchg(&hprobe->state, HPROBE_CONSUMED);
> 72a27524a4939f Andrii Nakryiko 2024-10-23  710          switch (*hstate) {
> 72a27524a4939f Andrii Nakryiko 2024-10-23  711          case HPROBE_LEASED:
> 72a27524a4939f Andrii Nakryiko 2024-10-23  712          case HPROBE_STABLE:
> 72a27524a4939f Andrii Nakryiko 2024-10-23  713                  return hprobe->uprobe;
> 72a27524a4939f Andrii Nakryiko 2024-10-23  714          case HPROBE_GONE:       /* uprobe is NULL, no SRCU */
> 72a27524a4939f Andrii Nakryiko 2024-10-23  715          case HPROBE_CONSUMED:   /* uprobe was finalized already, do nothing */
> 72a27524a4939f Andrii Nakryiko 2024-10-23  716                  return NULL;
> 72a27524a4939f Andrii Nakryiko 2024-10-23  717          default:
> 72a27524a4939f Andrii Nakryiko 2024-10-23 @718                  WARN(1, "hprobe invalid state %d", state);
>
> s/state/*hstate/?

yep, oops, will send a fix soon, thank you!

>
> 72a27524a4939f Andrii Nakryiko 2024-10-23  719                  return NULL;
> 72a27524a4939f Andrii Nakryiko 2024-10-23  720          }
> 72a27524a4939f Andrii Nakryiko 2024-10-23  721  }
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-30 15:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-30 12:15 [peterz-queue:perf/core 21/21] kernel/events/uprobes.c:718 hprobe_consume() error: uninitialized symbol 'state' kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2024-10-30 12:49 Dan Carpenter
2024-10-30 15:53 ` Andrii Nakryiko

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.