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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Thu, 16 Sep 2021 15:14:13 +0800
From:   kernel test robot <lkp@...el.com>
To:     Liu Jian <liujian56@...wei.com>, john.fastabend@...il.com,
        daniel@...earbox.net, jakub@...udflare.com, lmb@...udflare.com,
        davem@...emloft.net, kuba@...nel.org, netdev@...r.kernel.org,
        bpf@...r.kernel.org
Cc:     kbuild-all@...ts.01.org, liujian56@...wei.com
Subject: Re: [PATCH] skmsg: lose offset info in sk_psock_skb_ingress

Hi Liu,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linus/master]
[also build test ERROR on v5.15-rc1 next-20210915]
[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/Liu-Jian/skmsg-lose-offset-info-in-sk_psock_skb_ingress/20210915-220839
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 3ca706c189db861b2ca2019a0901b94050ca49d8
config: h8300-randconfig-r031-20210916 (attached as .config)
compiler: h8300-linux-gcc (GCC) 11.2.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/7736d12e30a2ff3579225cc593898ef1a24dc7aa
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Liu-Jian/skmsg-lose-offset-info-in-sk_psock_skb_ingress/20210915-220839
        git checkout 7736d12e30a2ff3579225cc593898ef1a24dc7aa
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=h8300 SHELL=/bin/bash net/core/

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

All errors (new ones prefixed by >>):

   In file included from include/linux/kernel.h:11,
                    from include/linux/list.h:9,
                    from include/linux/timer.h:5,
                    from include/linux/workqueue.h:9,
                    from include/linux/bpf.h:9,
                    from include/linux/skmsg.h:7,
                    from net/core/skmsg.c:4:
   include/linux/scatterlist.h: In function 'sg_set_buf':
   include/asm-generic/page.h:89:51: warning: ordered comparison of pointer with null pointer [-Wextra]
      89 | #define virt_addr_valid(kaddr)  (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \
         |                                                   ^~
   include/linux/compiler.h:78:45: note: in definition of macro 'unlikely'
      78 | # define unlikely(x)    __builtin_expect(!!(x), 0)
         |                                             ^
   include/linux/scatterlist.h:143:9: note: in expansion of macro 'BUG_ON'
     143 |         BUG_ON(!virt_addr_valid(buf));
         |         ^~~~~~
   include/linux/scatterlist.h:143:17: note: in expansion of macro 'virt_addr_valid'
     143 |         BUG_ON(!virt_addr_valid(buf));
         |                 ^~~~~~~~~~~~~~~
   net/core/skmsg.c: In function 'sk_psock_verdict_apply':
>> net/core/skmsg.c:972:25: error: 'len' undeclared (first use in this function)
     972 |                         len = skb->len;
         |                         ^~~
   net/core/skmsg.c:972:25: note: each undeclared identifier is reported only once for each function it appears in
>> net/core/skmsg.c:973:25: error: 'off' undeclared (first use in this function)
     973 |                         off = 0;
         |                         ^~~
   net/core/skmsg.c: At top level:
   net/core/skmsg.c:12:13: warning: 'sk_psock_strp_data_ready' declared 'static' but never defined [-Wunused-function]
      12 | static void sk_psock_strp_data_ready(struct sock *sk);
         |             ^~~~~~~~~~~~~~~~~~~~~~~~


vim +/len +972 net/core/skmsg.c

   953	
   954		switch (verdict) {
   955		case __SK_PASS:
   956			err = -EIO;
   957			sk_other = psock->sk;
   958			if (sock_flag(sk_other, SOCK_DEAD) ||
   959			    !sk_psock_test_state(psock, SK_PSOCK_TX_ENABLED)) {
   960				goto out_free;
   961			}
   962	
   963			skb_bpf_set_ingress(skb);
   964	
   965			/* If the queue is empty then we can submit directly
   966			 * into the msg queue. If its not empty we have to
   967			 * queue work otherwise we may get OOO data. Otherwise,
   968			 * if sk_psock_skb_ingress errors will be handled by
   969			 * retrying later from workqueue.
   970			 */
   971			if (skb_queue_empty(&psock->ingress_skb)) {
 > 972				len = skb->len;
 > 973				off = 0;
   974	#if IS_ENABLED(CONFIG_BPF_STREAM_PARSER)
   975				if (psock->sk->sk_data_ready == sk_psock_strp_data_ready) {
   976					stm = strp_msg(skb);
   977					off = stm->offset;
   978					len = stm->full_len;
   979				}
   980	#endif
   981				err = sk_psock_skb_ingress_self(psock, skb, off, len);
   982			}
   983			if (err < 0) {
   984				spin_lock_bh(&psock->ingress_lock);
   985				if (sk_psock_test_state(psock, SK_PSOCK_TX_ENABLED)) {
   986					skb_queue_tail(&psock->ingress_skb, skb);
   987					schedule_work(&psock->work);
   988					err = 0;
   989				}
   990				spin_unlock_bh(&psock->ingress_lock);
   991				if (err < 0) {
   992					skb_bpf_redirect_clear(skb);
   993					goto out_free;
   994				}
   995			}
   996			break;
   997		case __SK_REDIRECT:
   998			err = sk_psock_skb_redirect(psock, skb);
   999			break;
  1000		case __SK_DROP:
  1001		default:
  1002	out_free:
  1003			sock_drop(psock->sk, skb);
  1004		}
  1005	
  1006		return err;
  1007	}
  1008	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ