:::::: 
:::::: 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: [email protected]
BCC: [email protected]
CC: [email protected]
TO: Masami Hiramatsu <[email protected]>
CC: "Steven Rostedt (VMware)" <[email protected]>

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/[email protected]/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 <[email protected]>


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
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to