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  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 9 Oct 2020 15:27:57 +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, netdev@...r.kernel.org,
        bpf@...r.kernel.org, jakub@...udflare.com, lmb@...udflare.com
Subject: Re: [bpf-next PATCH 4/6] bpf, sockmap: remove dropped data on errors
 in redirect case

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: riscv-allyesconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 9.3.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://github.com/0day-ci/linux/commit/3a8d6f22c5f47a013278031170cb559d1f6d1e69
        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 3a8d6f22c5f47a013278031170cb559d1f6d1e69
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=riscv 

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: In function 'sk_psock_skb_redirect':
>> net/core/skmsg.c:714:7: warning: variable 'ingress' set but not used [-Wunused-but-set-variable]
     714 |  bool ingress;
         |       ^~~~~~~

vim +/ingress +714 net/core/skmsg.c

604326b41a6fb9 Daniel Borkmann 2018-10-13  709  
93dd5f185916b0 John Fastabend  2020-06-25  710  static void sk_psock_skb_redirect(struct sk_buff *skb)
604326b41a6fb9 Daniel Borkmann 2018-10-13  711  {
604326b41a6fb9 Daniel Borkmann 2018-10-13  712  	struct sk_psock *psock_other;
604326b41a6fb9 Daniel Borkmann 2018-10-13  713  	struct sock *sk_other;
604326b41a6fb9 Daniel Borkmann 2018-10-13 @714  	bool ingress;
604326b41a6fb9 Daniel Borkmann 2018-10-13  715  
ca2f5f21dbbd5e John Fastabend  2020-05-29  716  	sk_other = tcp_skb_bpf_redirect_fetch(skb);
3a8d6f22c5f47a John Fastabend  2020-10-08  717  	/* This error is a buggy BPF program, it returned a redirect
3a8d6f22c5f47a John Fastabend  2020-10-08  718  	 * return code, but then didn't set a redirect interface.
3a8d6f22c5f47a John Fastabend  2020-10-08  719  	 */
ca2f5f21dbbd5e John Fastabend  2020-05-29  720  	if (unlikely(!sk_other)) {
ca2f5f21dbbd5e John Fastabend  2020-05-29  721  		kfree_skb(skb);
ca2f5f21dbbd5e John Fastabend  2020-05-29  722  		return;
ca2f5f21dbbd5e John Fastabend  2020-05-29  723  	}
ca2f5f21dbbd5e John Fastabend  2020-05-29  724  	psock_other = sk_psock(sk_other);
3a8d6f22c5f47a John Fastabend  2020-10-08  725  	/* This error indicates the socket is being torn down or had another
3a8d6f22c5f47a John Fastabend  2020-10-08  726  	 * error that caused the pipe to break. We can't send a packet on
3a8d6f22c5f47a John Fastabend  2020-10-08  727  	 * a socket that is in this state so we drop the skb.
3a8d6f22c5f47a John Fastabend  2020-10-08  728  	 */
ca2f5f21dbbd5e John Fastabend  2020-05-29  729  	if (!psock_other || sock_flag(sk_other, SOCK_DEAD) ||
ca2f5f21dbbd5e John Fastabend  2020-05-29  730  	    !sk_psock_test_state(psock_other, SK_PSOCK_TX_ENABLED)) {
ca2f5f21dbbd5e John Fastabend  2020-05-29  731  		kfree_skb(skb);
ca2f5f21dbbd5e John Fastabend  2020-05-29  732  		return;
ca2f5f21dbbd5e John Fastabend  2020-05-29  733  	}
ca2f5f21dbbd5e John Fastabend  2020-05-29  734  
ca2f5f21dbbd5e John Fastabend  2020-05-29  735  	ingress = tcp_skb_bpf_ingress(skb);
ca2f5f21dbbd5e John Fastabend  2020-05-29  736  	skb_queue_tail(&psock_other->ingress_skb, skb);
ca2f5f21dbbd5e John Fastabend  2020-05-29  737  	schedule_work(&psock_other->work);
ca2f5f21dbbd5e John Fastabend  2020-05-29  738  }
ca2f5f21dbbd5e John Fastabend  2020-05-29  739  

---
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" (66191 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ