Re: [PATCH bpf-next 5/8] bpf: Add link-based BPF program attachment to network namespace

7 views
Skip to first unread message

kbuild test robot

unread,
May 27, 2020, 11:19:18 PM5/27/20
to Jakub Sitnicki, b...@vger.kernel.org, kbuil...@lists.01.org, clang-bu...@googlegroups.com, net...@vger.kernel.org, kerne...@cloudflare.com
Hi Jakub,

I love your patch! Perhaps something to improve:

[auto build test WARNING on bpf-next/master]
[also build test WARNING on net-next/master next-20200526]
[cannot apply to bpf/master net/master linus/master v5.7-rc7]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url: https://github.com/0day-ci/linux/commits/Jakub-Sitnicki/Link-based-program-attachment-to-network-namespaces/20200528-011159
base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: arm-randconfig-r035-20200527 (attached as .config)
compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 3393cc4cebf9969db94dc424b7a2b6195589c33b)
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
# 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: kbuild test robot <l...@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

>> kernel/bpf/net_namespace.c:130:6: warning: variable 'inum' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
if (net)
^~~
kernel/bpf/net_namespace.c:134:26: note: uninitialized use occurs here
info->netns.netns_ino = inum;
^~~~
kernel/bpf/net_namespace.c:130:2: note: remove the 'if' if its condition is always true
if (net)
^~~~~~~~
kernel/bpf/net_namespace.c:123:19: note: initialize the variable 'inum' to silence this warning
unsigned int inum;
^
= 0
1 warning generated.

vim +130 kernel/bpf/net_namespace.c

118
119 static int bpf_netns_link_fill_info(const struct bpf_link *link,
120 struct bpf_link_info *info)
121 {
122 const struct bpf_netns_link *net_link;
123 unsigned int inum;
124 struct net *net;
125
126 net_link = container_of(link, struct bpf_netns_link, link);
127
128 rcu_read_lock();
129 net = rcu_dereference(net_link->net);
> 130 if (net)
131 inum = net->ns.inum;
132 rcu_read_unlock();
133
134 info->netns.netns_ino = inum;
135 info->netns.attach_type = net_link->type;
136 return 0;
137 }
138

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuil...@lists.01.org
.config.gz

Nick Desaulniers

unread,
Jun 4, 2020, 7:38:58 PM6/4/20
to Jakub Sitnicki, bpf, kbuil...@lists.01.org, clang-built-linux, Network Development, kerne...@cloudflare.com, kbuild test robot
On Wed, May 27, 2020 at 8:19 PM kbuild test robot <l...@intel.com> wrote:
>
> Hi Jakub,
>
> I love your patch! Perhaps something to improve:
>
> [auto build test WARNING on bpf-next/master]
> [also build test WARNING on net-next/master next-20200526]
> [cannot apply to bpf/master net/master linus/master v5.7-rc7]
> [if your patch is applied to the wrong git tree, please drop us a note to help
> improve the system. BTW, we also suggest to use '--base' option to specify the
> base tree in git format-patch, please see https://stackoverflow.com/a/37406982]
>
> url: https://github.com/0day-ci/linux/commits/Jakub-Sitnicki/Link-based-program-attachment-to-network-namespaces/20200528-011159
> base: https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
> config: arm-randconfig-r035-20200527 (attached as .config)
> compiler: clang version 11.0.0 (https://github.com/llvm/llvm-project 3393cc4cebf9969db94dc424b7a2b6195589c33b)
> 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
> # 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: kbuild test robot <l...@intel.com>
>
> All warnings (new ones prefixed by >>, old ones prefixed by <<):
>
> >> kernel/bpf/net_namespace.c:130:6: warning: variable 'inum' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]

This looks legit to me. Please fix.
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-li...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/202005281031.S7IMfvFG%25lkp%40intel.com.



--
Thanks,
~Nick Desaulniers

Jakub Sitnicki

unread,
Jun 5, 2020, 10:41:12 AM6/5/20
to Nick Desaulniers, bpf, kbuil...@lists.01.org, clang-built-linux, Network Development, kerne...@cloudflare.com, kbuild test robot
It is legit, or rather it was. Already fixed in v2 [0] (jump to
bpf_netns_link_fill_info).

[...]
Reply all
Reply to author
Forward
0 new messages