From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: kernel/trace/trace_probe.c:1061:30: warning: use of NULL 'event_name' where non-null expected [CWE-476]
Date: Sun, 03 Jul 2022 10:35:00 +0800 [thread overview]
Message-ID: <202207031004.PznWEg1J-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 8495 bytes --]
::::::
:::::: Manual check reason: "low confidence bisect report"
:::::: Manual check reason: "low confidence static check warning: kernel/trace/trace_probe.c:1061:30: warning: use of NULL 'event_name' where non-null expected [CWE-476] [-Wanalyzer-null-argument]"
::::::
CC: kbuild-all(a)lists.01.org
BCC: lkp(a)intel.com
CC: linux-kernel(a)vger.kernel.org
TO: Masami Hiramatsu <mhiramat@kernel.org>
CC: "Steven Rostedt (VMware)" <rostedt@goodmis.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 69cb6c6556ad89620547318439d6be8bb1629a5a
commit: 8e242060c6a4947e8ae7d29794af6a581db08841 tracing/probes: Reject events which have the same name of existing one
date: 11 months ago
:::::: branch date: 8 hours ago
:::::: commit date: 11 months ago
config: arm-randconfig-c002-20220702 (https://download.01.org/0day-ci/archive/20220703/202207031004.PznWEg1J-lkp(a)intel.com/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.3.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/torvalds/linux.git/commit/?id=8e242060c6a4947e8ae7d29794af6a581db08841
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout 8e242060c6a4947e8ae7d29794af6a581db08841
# save the config file
ARCH=arm KBUILD_USERCFLAGS='-fanalyzer -Wno-error'
If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@intel.com>
gcc-analyzer warnings: (new ones prefixed by >>)
kernel/trace/trace_probe.c: In function 'find_trace_event_call':
>> kernel/trace/trace_probe.c:1061:30: warning: use of NULL 'event_name' where non-null expected [CWE-476] [-Wanalyzer-null-argument]
1061 | if (!name || strcmp(event_name, name))
| ^~~~~~~~~~~~~~~~~~~~~~~~
'trace_probe_register_event_call': event 1
|
| 1069 | int trace_probe_register_event_call(struct trace_probe *tp)
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | (1) entry to 'trace_probe_register_event_call'
|
'trace_probe_register_event_call': event 2
|
|include/asm-generic/bug.h:121:29:
| 121 | int __ret_warn_on = !!(condition); \
| | ^~~~~~~~~~~~~
| | |
| | (2) following 'false' branch...
include/linux/lockdep.h:310:17: note: in expansion of macro 'WARN_ON'
| 310 | WARN_ON(debug_locks && \
| | ^~~~~~~
kernel/trace/trace_probe.c:1074:9: note: in expansion of macro 'lockdep_assert_held'
| 1074 | lockdep_assert_held(&event_mutex);
| | ^~~~~~~~~~~~~~~~~~~
|
'trace_probe_register_event_call': event 3
|
|kernel/trace/trace_probe.h:284:18:
| 284 | return tp->event->call.class->system;
| | ~~^~~~~~~
| | |
| | (3) ...to here
|
'trace_probe_register_event_call': event 4
|
|kernel/trace/trace_probe.c:1076:13:
| 1076 | if (find_trace_event_call(trace_probe_group_name(tp),
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | (4) calling 'trace_probe_name' from 'trace_probe_register_event_call'
| 1077 | trace_probe_name(tp)))
| | ~~~~~~~~~~~~~~~~~~~~~
|
+--> 'trace_probe_name': event 5
|
|kernel/trace/trace_probe.h:277:27:
| 277 | static inline const char *trace_probe_name(struct trace_probe *tp)
| | ^~~~~~~~~~~~~~~~
| | |
| | (5) entry to 'trace_probe_name'
|
'trace_probe_name': events 6-7
|
|include/linux/trace_events.h:439:12:
| 439 | if (call->flags & TRACE_EVENT_FL_TRACEPOINT)
| | ^
| | |
| | (6) following 'true' branch...
| 440 | return call->tp ? call->tp->name : NULL;
| | ~~~~~~~~
| | |
| | (7) ...to here
|
'trace_probe_name': event 8
|
| 440 | return call->tp ? call->tp->name : NULL;
|
'trace_probe_name': event 9
|
|kernel/trace/trace_probe.h:279:16:
| 279 | return trace_event_name(&tp->event->call);
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | (9) ...to here
|
<------+
|
'trace_probe_register_event_call': events 10-11
|
|kernel/trace/trace_probe.c:1076:13:
| 1076 | if (find_trace_event_call(trace_probe_group_name(tp),
| | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| | |
| | (10) returning to 'trace_probe_register_event_call' from 'trace_probe_name'
| | (11) calling 'find_trace_event_call' from 'trace_probe_register_event_call'
| 1077 | trace_probe_name(tp)))
| | ~~~~~~~~~~~~~~~~~~~~~
|
+--> 'find_trace_event_call': event 12
|
| 1051 | find_trace_event_call(const char *system, const char *event_name)
| | ^~~~~~~~~~~~~~~~~~~~~
| | |
| | (12) entry to 'find_trace_event_call'
|
'find_trace_event_call': event 13
|
|include/linux/list.h:629:14:
| 629 | !list_entry_is_head(pos, head, member); \
| | ^
| | |
| | (13) following 'true' branch...
vim +/event_name +1061 kernel/trace/trace_probe.c
46e5376d404d14 Masami Hiramatsu 2019-06-01 1049
8e242060c6a494 Masami Hiramatsu 2021-08-19 1050 static struct trace_event_call *
8e242060c6a494 Masami Hiramatsu 2021-08-19 1051 find_trace_event_call(const char *system, const char *event_name)
8e242060c6a494 Masami Hiramatsu 2021-08-19 1052 {
8e242060c6a494 Masami Hiramatsu 2021-08-19 1053 struct trace_event_call *tp_event;
8e242060c6a494 Masami Hiramatsu 2021-08-19 1054 const char *name;
8e242060c6a494 Masami Hiramatsu 2021-08-19 1055
8e242060c6a494 Masami Hiramatsu 2021-08-19 1056 list_for_each_entry(tp_event, &ftrace_events, list) {
8e242060c6a494 Masami Hiramatsu 2021-08-19 1057 if (!tp_event->class->system ||
8e242060c6a494 Masami Hiramatsu 2021-08-19 1058 strcmp(system, tp_event->class->system))
8e242060c6a494 Masami Hiramatsu 2021-08-19 1059 continue;
8e242060c6a494 Masami Hiramatsu 2021-08-19 1060 name = trace_event_name(tp_event);
8e242060c6a494 Masami Hiramatsu 2021-08-19 @1061 if (!name || strcmp(event_name, name))
8e242060c6a494 Masami Hiramatsu 2021-08-19 1062 continue;
8e242060c6a494 Masami Hiramatsu 2021-08-19 1063 return tp_event;
8e242060c6a494 Masami Hiramatsu 2021-08-19 1064 }
8e242060c6a494 Masami Hiramatsu 2021-08-19 1065
8e242060c6a494 Masami Hiramatsu 2021-08-19 1066 return NULL;
8e242060c6a494 Masami Hiramatsu 2021-08-19 1067 }
8e242060c6a494 Masami Hiramatsu 2021-08-19 1068
--
0-DAY CI Kernel Test Service
https://01.org/lkp
next reply other threads:[~2022-07-03 2:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-03 2:35 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2022-08-06 13:17 kernel/trace/trace_probe.c:1061:30: warning: use of NULL 'event_name' where non-null expected [CWE-476] kernel test robot
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=202207031004.PznWEg1J-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild@lists.01.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.