All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Steven Rostedt <rostedt@goodmis.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux Trace Kernel <linux-trace-kernel@vger.kernel.org>
Cc: oe-kbuild-all@lists.linux.dev,
	Masami Hiramatsu <mhiramat@kernel.org>,
	Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: Re: [PATCH] tracing: Take trace_array reference when opening options file
Date: Wed, 2 Sep 2026 18:36:45 +0800	[thread overview]
Message-ID: <202609021814.YH14WR0q-lkp@intel.com> (raw)
In-Reply-To: <20260901163620.6cbe0ada@gandalf.local.home>

Hi Steven,

kernel test robot noticed the following build warnings:

[auto build test WARNING on trace/for-next]
[also build test WARNING on linus/master v7.3-rc1 next-20260901]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Steven-Rostedt/tracing-Take-trace_array-reference-when-opening-options-file/20260901-163620
base:   https://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace for-next
patch link:    https://lore.kernel.org/r/20260901163620.6cbe0ada%40gandalf.local.home
patch subject: [PATCH] tracing: Take trace_array reference when opening options file
config: openrisc-randconfig-r072-20260902 (https://download.01.org/0day-ci/archive/20260902/202609021814.YH14WR0q-lkp@intel.com/config)
compiler: or1k-linux-gcc (GCC) 14.3.0
smatch: v0.5.0-9187-g5189e3fb
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260902/202609021814.YH14WR0q-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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202609021814.YH14WR0q-lkp@intel.com/

All warnings (new ones prefixed by >>):

   kernel/trace/trace.c: In function 'trace_array_options_get':
>> kernel/trace/trace.c:7871:30: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types]
    7871 |                 if (tr_index >= &tr->trace_flags_index[0] &&
         |                              ^~
   kernel/trace/trace.c:7872:30: warning: comparison of distinct pointer types lacks a cast [-Wcompare-distinct-pointer-types]
    7872 |                     tr_index < &tr->trace_flags_index[TRACE_FLAGS_MAX_SIZE])
         |                              ^


vim +7871 kernel/trace/trace.c

  7844	
  7845	/*
  7846	 * The tr_index is the address of a trace_array->trace_flags_index[]
  7847	 * element that holds the index of the trace flag. But since the
  7848	 * trace_array reference has not been taken yet, it cannot be referenced
  7849	 * as it could have been freed by a rmdir of the instance the trace_array
  7850	 * represents.
  7851	 *
  7852	 * Search the list of trace_arrays and compare the tr_index to the
  7853	 * address of the entire trace_array trace_flags_index array for each
  7854	 * trace_array in the list. If one is matched, then take the reference
  7855	 * and return it. If not, the trace_array no longer exits.
  7856	 */
  7857	static int trace_array_options_get(void *tr_index)
  7858	{
  7859		struct trace_array *tr;
  7860		int ret;
  7861	
  7862		ret = security_locked_down(LOCKDOWN_TRACEFS);
  7863		if (ret)
  7864			return ret;
  7865	
  7866		if (tracing_disabled)
  7867			return -ENODEV;
  7868	
  7869		guard(mutex)(&trace_types_lock);
  7870		list_for_each_entry(tr, &ftrace_trace_arrays, list) {
> 7871			if (tr_index >= &tr->trace_flags_index[0] &&
  7872			    tr_index < &tr->trace_flags_index[TRACE_FLAGS_MAX_SIZE])
  7873				return __trace_array_get(tr);
  7874		}
  7875		return -ENODEV;
  7876	}
  7877	

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

  parent reply	other threads:[~2026-09-02 10:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-01 20:36 [PATCH] tracing: Take trace_array reference when opening options file Steven Rostedt
2026-09-01 20:54 ` sashiko-bot
2026-09-01 23:13   ` Steven Rostedt
2026-09-02  0:32     ` Steven Rostedt
2026-09-02 10:36 ` kernel test robot [this message]
2026-09-02 13:47   ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202609021814.YH14WR0q-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=rostedt@goodmis.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.