lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Fri, 9 Oct 2020 15:28:50 +0800
From:   kernel test robot <lkp@...el.com>
To:     John Fastabend <john.fastabend@...il.com>,
        alexei.starovoitov@...il.com, daniel@...earbox.net
Cc:     kbuild-all@...ts.01.org, clang-built-linux@...glegroups.com,
        netdev@...r.kernel.org, bpf@...r.kernel.org, jakub@...udflare.com,
        lmb@...udflare.com
Subject: Re: [bpf-next PATCH 2/6] bpf, sockmap: On receive programs try to
 fast track SK_PASS ingress

Hi John,

I love your patch! Perhaps something to improve:

[auto build test WARNING on bpf-next/master]

url:    https://github.com/0day-ci/linux/commits/John-Fastabend/sockmap-sk_skb-program-memory-acct-fixes/20201009-124625
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
config: x86_64-randconfig-a003-20201009 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 4cfc4025cc1433ca5ef1c526053fc9c4bfe64109)
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 x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/34f009aa63482e7bd76b64e4e3c698894e48ee00
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review John-Fastabend/sockmap-sk_skb-program-memory-acct-fixes/20201009-124625
        git checkout 34f009aa63482e7bd76b64e4e3c698894e48ee00
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

>> net/core/skmsg.c:795:7: warning: variable 'err' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
                   if (skb_queue_empty(&psock->ingress_skb)) {
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/core/skmsg.c:798:7: note: uninitialized use occurs here
                   if (err < 0) {
                       ^~~
   net/core/skmsg.c:795:3: note: remove the 'if' if its condition is always true
                   if (skb_queue_empty(&psock->ingress_skb)) {
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   net/core/skmsg.c:776:9: note: initialize the variable 'err' to silence this warning
           int err;
                  ^
                   = 0
   1 warning generated.

vim +795 net/core/skmsg.c

   770	
   771	static void sk_psock_verdict_apply(struct sk_psock *psock,
   772					   struct sk_buff *skb, int verdict)
   773	{
   774		struct tcp_skb_cb *tcp;
   775		struct sock *sk_other;
   776		int err;
   777	
   778		switch (verdict) {
   779		case __SK_PASS:
   780			sk_other = psock->sk;
   781			if (sock_flag(sk_other, SOCK_DEAD) ||
   782			    !sk_psock_test_state(psock, SK_PSOCK_TX_ENABLED)) {
   783				goto out_free;
   784			}
   785	
   786			tcp = TCP_SKB_CB(skb);
   787			tcp->bpf.flags |= BPF_F_INGRESS;
   788	
   789			/* If the queue is empty then we can submit directly
   790			 * into the msg queue. If its not empty we have to
   791			 * queue work otherwise we may get OOO data. Otherwise,
   792			 * if sk_psock_skb_ingress errors will be handled by
   793			 * retrying later from workqueue.
   794			 */
 > 795			if (skb_queue_empty(&psock->ingress_skb)) {
   796				err = sk_psock_skb_ingress(psock, skb);
   797			}
   798			if (err < 0) {
   799				skb_queue_tail(&psock->ingress_skb, skb);
   800				schedule_work(&psock->work);
   801			}
   802			break;
   803		case __SK_REDIRECT:
   804			sk_psock_skb_redirect(skb);
   805			break;
   806		case __SK_DROP:
   807		default:
   808	out_free:
   809			kfree_skb(skb);
   810		}
   811	}
   812	

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

Download attachment ".config.gz" of type "application/gzip" (33154 bytes)

Powered by blists - more mailing lists