From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [linux-next:master 2296/2770] kernel/bpf/helpers.c:713:43: warning: Uninitialized variable: bufs [uninitvar]
Date: Fri, 14 May 2021 00:10:08 +0800 [thread overview]
Message-ID: <202105140006.1O9TwMPz-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 2904 bytes --]
CC: kbuild-all(a)lists.01.org
CC: Linux Memory Management List <linux-mm@kvack.org>
TO: Florent Revest <revest@chromium.org>
CC: Alexei Starovoitov <ast@kernel.org>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: ec2618180c3450d06a6a4ba951d4c9a2c689b517
commit: e2d5b2bb769fa5f500760caba76436ba3a10a895 [2296/2770] bpf: Fix nested bpf_bprintf_prepare with more per-cpu buffers
:::::: branch date: 10 hours ago
:::::: commit date: 2 days ago
compiler: sparc64-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
>> kernel/bpf/helpers.c:713:43: warning: Uninitialized variable: bufs [uninitvar]
if (WARN_ON_ONCE(nest_level > ARRAY_SIZE(bufs->tmp_bufs))) {
^
kernel/bpf/helpers.c:408:20: warning: Possible null pointer dereference: storage [nullPointer]
ptr = &READ_ONCE(storage->buf)->data[0];
^
kernel/bpf/helpers.c:395:39: note: Assignment 'storage=NULL', assigned value is 0
struct bpf_cgroup_storage *storage = NULL;
^
kernel/bpf/helpers.c:408:20: note: Null pointer dereference
ptr = &READ_ONCE(storage->buf)->data[0];
^
vim +713 kernel/bpf/helpers.c
d9c9e4db186ab4 Florent Revest 2021-04-19 705
d9c9e4db186ab4 Florent Revest 2021-04-19 706 static int try_get_fmt_tmp_buf(char **tmp_buf)
d9c9e4db186ab4 Florent Revest 2021-04-19 707 {
e2d5b2bb769fa5 Florent Revest 2021-05-11 708 struct bpf_bprintf_buffers *bufs;
e2d5b2bb769fa5 Florent Revest 2021-05-11 709 int nest_level;
d9c9e4db186ab4 Florent Revest 2021-04-19 710
d9c9e4db186ab4 Florent Revest 2021-04-19 711 preempt_disable();
e2d5b2bb769fa5 Florent Revest 2021-05-11 712 nest_level = this_cpu_inc_return(bpf_bprintf_nest_level);
e2d5b2bb769fa5 Florent Revest 2021-05-11 @713 if (WARN_ON_ONCE(nest_level > ARRAY_SIZE(bufs->tmp_bufs))) {
e2d5b2bb769fa5 Florent Revest 2021-05-11 714 this_cpu_dec(bpf_bprintf_nest_level);
d9c9e4db186ab4 Florent Revest 2021-04-19 715 preempt_enable();
d9c9e4db186ab4 Florent Revest 2021-04-19 716 return -EBUSY;
d9c9e4db186ab4 Florent Revest 2021-04-19 717 }
e2d5b2bb769fa5 Florent Revest 2021-05-11 718 bufs = this_cpu_ptr(&bpf_bprintf_bufs);
e2d5b2bb769fa5 Florent Revest 2021-05-11 719 *tmp_buf = bufs->tmp_bufs[nest_level - 1];
d9c9e4db186ab4 Florent Revest 2021-04-19 720
d9c9e4db186ab4 Florent Revest 2021-04-19 721 return 0;
d9c9e4db186ab4 Florent Revest 2021-04-19 722 }
d9c9e4db186ab4 Florent Revest 2021-04-19 723
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
next reply other threads:[~2021-05-13 16:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-13 16:10 kernel test robot [this message]
2021-05-14 6:36 [linux-next:master 2296/2770] kernel/bpf/helpers.c:713:43: warning: Uninitialized variable: bufs [uninitvar] kernel test robot
2021-05-14 6:36 ` kernel test robot
2021-05-14 14:10 ` Florent Revest
2021-05-14 14:10 ` Florent Revest
2021-05-14 14:17 ` Alexei Starovoitov
2021-05-14 14:17 ` Alexei Starovoitov
2021-05-17 9:30 ` Florent Revest
2021-05-17 9:30 ` Florent Revest
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=202105140006.1O9TwMPz-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.