:::::: 
:::::: Manual check reason: "low confidence bisect report"
:::::: Manual check reason: "low confidence static check warning: 
kernel/trace/trace_eprobe.c:340:12: warning: use of uninitialized value 
'<unknown>' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]"
:::::: 

BCC: [email protected]
CC: [email protected]
CC: [email protected]
TO: "Tzvetomir Stoyanov (VMware)" <[email protected]>
CC: "Steven Rostedt (VMware)" <[email protected]>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 
master
head:   4d1044fcb996e8de9b9ab392f4a767890e45202d
commit: 7491e2c442781a1860181adb5ab472a52075f393 tracing: Add a probe that 
attaches to trace events
date:   12 months ago
:::::: branch date: 3 hours ago
:::::: commit date: 12 months ago
config: arm-randconfig-c002-20220804 
(https://download.01.org/0day-ci/archive/20220807/[email protected]/config)
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.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=7491e2c442781a1860181adb5ab472a52075f393
        git remote add linus 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout 7491e2c442781a1860181adb5ab472a52075f393
        # save the config file
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross 
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 >>)
                     |  400 | {
                     |  401 |         if (call->flags & TRACE_EVENT_FL_DYNAMIC)
                     |      |            ~        
                     |      |            |
                     |      |            (25) following 'false' branch...
                     |
                   'trace_event_try_get_ref': event 26
                     |
                     |cc1:
                     | (26): ...to here
                     |
              <------+
              |
            'find_and_get_event': events 27-28
              |
              |kernel/trace/trace_eprobe.c:775:22:
              |  775 |                 if (!trace_event_try_get_ref(tp_event)) {
              |      |                    ~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              |      |                    | |
              |      |                    | (27) returning to 
'find_and_get_event' from 'trace_event_try_get_ref'
              |      |                    (28) following 'true' branch...
              |
            'find_and_get_event': event 29
              |
              |cc1:
              | (29): ...to here
              |
       <------+
       |
     '__trace_eprobe_create': events 30-31
       |
       |  846 |         event_call = find_and_get_event(sys_name, sys_event);
       |      |                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       |      |                      |
       |      |                      (30) returning to '__trace_eprobe_create' 
from 'find_and_get_event'
       |  847 |         ep = alloc_event_probe(group, event, event_call, argc - 
2);
       |      |              
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       |      |              |
       |      |              (31) calling 'alloc_event_probe' from 
'__trace_eprobe_create'
       |
       +--> 'alloc_event_probe': events 32-35
              |
              |  136 | static struct trace_eprobe *alloc_event_probe(const char 
*group,
              |      |                             ^~~~~~~~~~~~~~~~~
              |      |                             |
              |      |                             (32) entry to 
'alloc_event_probe'
              |......
              |  146 |         if (!event)
              |      |            ~                 
              |      |            |
              |      |            (33) following 'false' branch (when 'event' 
is non-NULL)...
              |......
              |  149 |         sys_name = event->class->system;
              |      |                    ~~~~~~~~~~~~
              |      |                         |
              |      |                         (34) ...to here
              |......
              |  152 |         ep = kzalloc(struct_size(ep, tp.args, nargs), 
GFP_KERNEL);
              |      |              
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              |      |              |
              |      |              (35) calling 'kzalloc' from 
'alloc_event_probe'
              |
              +--> 'kzalloc': events 36-38
                     |
                     |include/linux/slab.h:719:21:
                     |  579 |         if (__builtin_constant_p(size)) {
                     |      |            ~         
                     |      |            |
                     |      |            (37) following 'false' branch...
                     |......
                     |  596 |         return __kmalloc(size, flags);
                     |      |                ~~~~~~~~~~~~~~~~~~~~~~
                     |      |                |
                     |      |                (38) ...to here
                     |......
                     |  719 | static inline void *kzalloc(size_t size, gfp_t 
flags)
                     |      |                     ^~~~~~~
                     |      |                     |
                     |      |                     (36) entry to 'kzalloc'
                     |
              <------+
              |
            'alloc_event_probe': events 39-42
              |
              |kernel/trace/trace_eprobe.c:152:14:
              |  152 |         ep = kzalloc(struct_size(ep, tp.args, nargs), 
GFP_KERNEL);
              |      |              
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              |      |              |
              |      |              (39) returning to 'alloc_event_probe' from 
'kzalloc'
              |  153 |         if (!ep) {
              |      |            ~  
              |      |            |
              |      |            (40) following 'true' branch (when 'ep' is 
NULL)...
              |  154 |                 trace_event_put_ref(ep->event);
              |      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              |      |                 |
              |      |                 (41) ...to here
              |      |                 (42) dereference of NULL '0'
              |
   kernel/trace/trace_eprobe.c: In function 'fetch_store_strlen':
>> kernel/trace/trace_eprobe.c:340:12: warning: use of uninitialized value 
>> '<unknown>' [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
     340 |         u8 c;
         |            ^
     'eprobe_trigger_func': events 1-2
       |
       |  494 | static void eprobe_trigger_func(struct event_trigger_data *data,
       |      |             ^~~~~~~~~~~~~~~~~~~
       |      |             |
       |      |             (1) entry to 'eprobe_trigger_func'
       |......
       |  500 |         __eprobe_trace_func(edata, rec);
       |      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       |      |         |
       |      |         (2) calling '__eprobe_trace_func' from 
'eprobe_trigger_func'
       |
       +--> '__eprobe_trace_func': events 3-8
              |
              |  431 | __eprobe_trace_func(struct eprobe_data *edata, void *rec)
              |      | ^~~~~~~~~~~~~~~~~~~
              |      | |
              |      | (3) entry to '__eprobe_trace_func'
              |......
              |  438 |         if (WARN_ON_ONCE(call != 
edata->file->event_call))
              |      |            ~
              |      |            |
              |      |            (4) following 'false' branch...
              |......
              |  441 |         if (trace_trigger_soft_disabled(edata->file))
              |      |            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              |      |            ||
              |      |            |(5) ...to here
              |      |            (6) following 'false' branch...
              |......
              |  444 |         fbuffer.trace_ctx = tracing_gen_ctx();
              |      |                             ~~~~~~~~~~~~~~~~~
              |      |                             |
              |      |                             (7) ...to here
              |......
              |  447 |         dsize = get_eprobe_size(&edata->ep->tp, rec);
              |      |                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
              |      |                 |
              |      |                 (8) calling 'get_eprobe_size' from 
'__eprobe_trace_func'
              |
              +--> 'get_eprobe_size': events 9-14
                     |
                     |  292 | static int get_eprobe_size(struct trace_probe 
*tp, void *rec)
                     |      |            ^~~~~~~~~~~~~~~
                     |      |            |
                     |      |            (9) entry to 'get_eprobe_size'
                     |......
                     |  297 |         for (i = 0; i < tp->nr_args; i++) {
                     |      |                     ~~~~~~~~~~~~~~~
                     |      |                       |
                     |      |                       (10) following 'true' 
branch...
                     |  298 |                 arg = tp->args + i;
                     |      |                       ~~
                     |      |                       |
                     |      |                       (11) ...to here
                     |  299 |                 if (unlikely(arg->dynamic)) {
                     |      |                    ~
                     |      |                    |
                     |      |                    (12) following 'true' branch...
                     |......
                     |  302 |                         val = 
get_event_field(arg->code, rec);
                     |      |                               
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                     |      |                               |
                     |      |                               (13) ...to here
                     |  303 |                         len = 
process_fetch_insn_bottom(arg->code + 1, val, NULL, NULL);
                     |      |                               
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                     |      |                               |
                     |      |                               (14) calling 
'process_fetch_insn_bottom' from 'get_eprobe_size'
                     |
                     +--> 'process_fetch_insn_bottom': events 15-18
                            |
                            |kernel/trace/trace_probe_tmpl.h:72:1:
                            |   72 | process_fetch_insn_bottom(struct 
fetch_insn *code, unsigned long val,
                            |      | ^~~~~~~~~~~~~~~~~~~~~~~~~
                            |      | |
                            |      | (15) entry to 'process_fetch_insn_bottom'
                            |......
                            |   83 |                 if (code->op == 
FETCH_OP_DEREF) {
                            |      |                    ~
                            |      |                    |
                            |      |                    (16) following 'false' 
branch...
                            |......
                            |   87 |                 } else if (code->op == 
FETCH_OP_UDEREF) {
                            |      |                           ~
                            |      |                           |
                            |      |                           (17) ...to here
                            |      |                           (18) following 
'false' branch...
                            |
                          'process_fetch_insn_bottom': event 19
                            |
                            |cc1:
                            | (19): ...to here
                            |
                          'process_fetch_insn_bottom': events 20-24
                            |
                            |  101 |         if (unlikely(!dest)) {
                            |      |            ^
                            |      |            |

vim +340 kernel/trace/trace_eprobe.c

7491e2c442781a Tzvetomir Stoyanov (VMware  2021-08-19  334) 
7491e2c442781a Tzvetomir Stoyanov (VMware  2021-08-19  335) /* Return the 
length of string -- including null terminal byte */
7491e2c442781a Tzvetomir Stoyanov (VMware  2021-08-19  336) static 
nokprobe_inline int
7491e2c442781a Tzvetomir Stoyanov (VMware  2021-08-19  337) 
fetch_store_strlen(unsigned long addr)
7491e2c442781a Tzvetomir Stoyanov (VMware  2021-08-19  338) {
7491e2c442781a Tzvetomir Stoyanov (VMware  2021-08-19  339)     int ret, len = 
0;
7491e2c442781a Tzvetomir Stoyanov (VMware  2021-08-19 @340)     u8 c;
7491e2c442781a Tzvetomir Stoyanov (VMware  2021-08-19  341) 

-- 
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