From: kernel test robot <lkp@intel.com>
To: Yonghong Song <yhs@fb.com>, bpf@vger.kernel.org
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
kernel-team@fb.com, Jiri Olsa <jolsa@kernel.org>,
Roman Gushchin <guro@fb.com>
Subject: Re: [PATCH bpf-next 2/2] bpf: fix bpf_cgroup_storage_set() usage in test_run
Date: Fri, 19 Mar 2021 10:11:00 +0800 [thread overview]
Message-ID: <202103191048.0emdOqXr-lkp@intel.com> (raw)
In-Reply-To: <20210319001810.2166977-1-yhs@fb.com>
[-- Attachment #1: Type: text/plain, Size: 7295 bytes --]
Hi Yonghong,
I love your patch! Yet something to improve:
[auto build test ERROR on next-20210318]
[cannot apply to bpf-next/master bpf/master v5.12-rc3 v5.12-rc2 v5.12-rc1 v5.12-rc3]
[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]
url: https://github.com/0day-ci/linux/commits/Yonghong-Song/bpf-fix-NULL-pointer-dereference-in/20210319-082140
base: ba5b053ab3ac674b91a6669086139819359a5e6e
config: arm-randconfig-r014-20210318 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project fcc1ce00931751ac02498986feb37744e9ace8de)
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
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://github.com/0day-ci/linux/commit/4d3510a809c631ed53b78f7baa50fd4cc2730587
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Yonghong-Song/bpf-fix-NULL-pointer-dereference-in/20210319-082140
git checkout 4d3510a809c631ed53b78f7baa50fd4cc2730587
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> net/bpf/test_run.c:109:7: error: assigning to 'int' from incompatible type 'void'
ret = bpf_cgroup_storage_set(storage);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>> net/bpf/test_run.c:118:3: error: implicit declaration of function 'bpf_cgroup_storage_unset' [-Werror,-Wimplicit-function-declaration]
bpf_cgroup_storage_unset();
^
net/bpf/test_run.c:118:3: note: did you mean 'bpf_cgroup_storage_set'?
include/linux/bpf-cgroup.h:492:20: note: 'bpf_cgroup_storage_set' declared here
static inline void bpf_cgroup_storage_set(
^
net/bpf/test_run.c:167:14: warning: no previous prototype for function 'bpf_fentry_test1' [-Wmissing-prototypes]
int noinline bpf_fentry_test1(int a)
^
net/bpf/test_run.c:167:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int noinline bpf_fentry_test1(int a)
^
static
net/bpf/test_run.c:172:14: warning: no previous prototype for function 'bpf_fentry_test2' [-Wmissing-prototypes]
int noinline bpf_fentry_test2(int a, u64 b)
^
net/bpf/test_run.c:172:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int noinline bpf_fentry_test2(int a, u64 b)
^
static
net/bpf/test_run.c:177:14: warning: no previous prototype for function 'bpf_fentry_test3' [-Wmissing-prototypes]
int noinline bpf_fentry_test3(char a, int b, u64 c)
^
net/bpf/test_run.c:177:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int noinline bpf_fentry_test3(char a, int b, u64 c)
^
static
net/bpf/test_run.c:182:14: warning: no previous prototype for function 'bpf_fentry_test4' [-Wmissing-prototypes]
int noinline bpf_fentry_test4(void *a, char b, int c, u64 d)
^
net/bpf/test_run.c:182:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int noinline bpf_fentry_test4(void *a, char b, int c, u64 d)
^
static
net/bpf/test_run.c:187:14: warning: no previous prototype for function 'bpf_fentry_test5' [-Wmissing-prototypes]
int noinline bpf_fentry_test5(u64 a, void *b, short c, int d, u64 e)
^
net/bpf/test_run.c:187:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int noinline bpf_fentry_test5(u64 a, void *b, short c, int d, u64 e)
^
static
net/bpf/test_run.c:192:14: warning: no previous prototype for function 'bpf_fentry_test6' [-Wmissing-prototypes]
int noinline bpf_fentry_test6(u64 a, void *b, short c, int d, void *e, u64 f)
^
net/bpf/test_run.c:192:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int noinline bpf_fentry_test6(u64 a, void *b, short c, int d, void *e, u64 f)
^
static
net/bpf/test_run.c:201:14: warning: no previous prototype for function 'bpf_fentry_test7' [-Wmissing-prototypes]
int noinline bpf_fentry_test7(struct bpf_fentry_test_t *arg)
^
net/bpf/test_run.c:201:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int noinline bpf_fentry_test7(struct bpf_fentry_test_t *arg)
^
static
net/bpf/test_run.c:206:14: warning: no previous prototype for function 'bpf_fentry_test8' [-Wmissing-prototypes]
int noinline bpf_fentry_test8(struct bpf_fentry_test_t *arg)
^
net/bpf/test_run.c:206:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int noinline bpf_fentry_test8(struct bpf_fentry_test_t *arg)
^
static
net/bpf/test_run.c:211:14: warning: no previous prototype for function 'bpf_modify_return_test' [-Wmissing-prototypes]
int noinline bpf_modify_return_test(int a, int *b)
^
net/bpf/test_run.c:211:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int noinline bpf_modify_return_test(int a, int *b)
^
static
9 warnings and 2 errors generated.
vim +109 net/bpf/test_run.c
85
86 static int bpf_test_run(struct bpf_prog *prog, void *ctx, u32 repeat,
87 u32 *retval, u32 *time, bool xdp)
88 {
89 struct bpf_cgroup_storage *storage[MAX_BPF_CGROUP_STORAGE_TYPE] = { NULL };
90 struct bpf_test_timer t = { NO_MIGRATE };
91 enum bpf_cgroup_storage_type stype;
92 int ret;
93
94 for_each_cgroup_storage_type(stype) {
95 storage[stype] = bpf_cgroup_storage_alloc(prog, stype);
96 if (IS_ERR(storage[stype])) {
97 storage[stype] = NULL;
98 for_each_cgroup_storage_type(stype)
99 bpf_cgroup_storage_free(storage[stype]);
100 return -ENOMEM;
101 }
102 }
103
104 if (!repeat)
105 repeat = 1;
106
107 bpf_test_timer_enter(&t);
108 do {
> 109 ret = bpf_cgroup_storage_set(storage);
110 if (ret)
111 break;
112
113 if (xdp)
114 *retval = bpf_prog_run_xdp(prog, ctx);
115 else
116 *retval = BPF_PROG_RUN(prog, ctx);
117
> 118 bpf_cgroup_storage_unset();
119 } while (bpf_test_timer_continue(&t, repeat, &ret, time));
120 bpf_test_timer_leave(&t);
121
122 for_each_cgroup_storage_type(stype)
123 bpf_cgroup_storage_free(storage[stype]);
124
125 return ret;
126 }
127
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29781 bytes --]
prev parent reply other threads:[~2021-03-19 2:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-19 0:17 [PATCH bpf-next 0/2] bpf: fix NULL pointer dereference in Yonghong Song
2021-03-19 0:18 ` [PATCH bpf-next 1/2] bpf: fix NULL pointer dereference in bpf_get_local_storage() helper Yonghong Song
2021-03-19 1:37 ` kernel test robot
2021-03-19 2:40 ` kernel test robot
2021-03-19 0:18 ` [PATCH bpf-next 2/2] bpf: fix bpf_cgroup_storage_set() usage in test_run Yonghong Song
2021-03-19 2:11 ` kernel test robot [this message]
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=202103191048.0emdOqXr-lkp@intel.com \
--to=lkp@intel.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=clang-built-linux@googlegroups.com \
--cc=daniel@iogearbox.net \
--cc=guro@fb.com \
--cc=jolsa@kernel.org \
--cc=kbuild-all@lists.01.org \
--cc=kernel-team@fb.com \
--cc=yhs@fb.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox