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] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 31 Mar 2018 02:22:35 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Jesper Dangaard Brouer <brouer@...hat.com>
Cc:     kbuild-all@...org, netdev@...r.kernel.org,
        BjörnTöpel <bjorn.topel@...el.com>,
        magnus.karlsson@...el.com, eugenia@...lanox.com,
        Jason Wang <jasowang@...hat.com>,
        John Fastabend <john.fastabend@...il.com>,
        Eran Ben Elisha <eranbe@...lanox.com>,
        Saeed Mahameed <saeedm@...lanox.com>, galp@...lanox.com,
        Jesper Dangaard Brouer <brouer@...hat.com>,
        Daniel Borkmann <borkmann@...earbox.net>,
        Alexei Starovoitov <alexei.starovoitov@...il.com>,
        Tariq Toukan <tariqt@...lanox.com>
Subject: Re: [net-next V7 PATCH 07/16] virtio_net: convert to use generic
 xdp_frame and xdp_return_frame API

Hi Jesper,

Thank you for the patch! Perhaps something to improve:

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

url:    https://github.com/0day-ci/linux/commits/Jesper-Dangaard-Brouer/XDP-redirect-memory-return-API/20180330-203122
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

>> drivers/net/virtio_net.c:451:26: sparse: incorrect type in assignment (different base types) @@    expected restricted __virtio16 [usertype] hdr_len @@    got unsirestricted __virtio16 [usertype] hdr_len @@
   drivers/net/virtio_net.c:451:26:    expected restricted __virtio16 [usertype] hdr_len
   drivers/net/virtio_net.c:451:26:    got unsigned short [unsigned] [usertype] len
   drivers/net/virtio_net.c:2140:27: sparse: incorrect type in assignment (different base types) @@    expected unsigned long long [unsigned] [usertype] ctrl_offloads @@    got unsigned] [usertype] ctrl_offloads @@
   drivers/net/virtio_net.c:2140:27:    expected unsigned long long [unsigned] [usertype] ctrl_offloads
   drivers/net/virtio_net.c:2140:27:    got restricted __virtio64

vim +451 drivers/net/virtio_net.c

   417	
   418	static bool __virtnet_xdp_xmit(struct virtnet_info *vi,
   419				       struct xdp_buff *xdp)
   420	{
   421		struct virtio_net_hdr_mrg_rxbuf *hdr;
   422		struct xdp_frame *xdpf, *xdpf_sent;
   423		struct send_queue *sq;
   424		unsigned int len;
   425		unsigned int qp;
   426		int err;
   427	
   428		qp = vi->curr_queue_pairs - vi->xdp_queue_pairs + smp_processor_id();
   429		sq = &vi->sq[qp];
   430	
   431		/* Free up any pending old buffers before queueing new ones. */
   432		while ((xdpf_sent = virtqueue_get_buf(sq->vq, &len)) != NULL)
   433			xdp_return_frame(xdpf_sent->data, &xdpf_sent->mem);
   434	
   435		xdpf = convert_to_xdp_frame(xdp);
   436		if (unlikely(!xdpf))
   437			return -EOVERFLOW;
   438	
   439		/* virtqueue want to use data area in-front of packet */
   440		if (unlikely(xdpf->metasize > 0))
   441			return -EOPNOTSUPP;
   442	
   443		if (unlikely(xdpf->headroom < vi->hdr_len))
   444			return -EOVERFLOW;
   445	
   446		/* Make room for virtqueue hdr (also change xdpf->headroom?) */
   447		xdpf->data -= vi->hdr_len;
   448		/* Zero header and leave csum up to XDP layers */
   449		hdr = xdpf->data;
   450		memset(hdr, 0, vi->hdr_len);
 > 451		hdr->hdr.hdr_len = xdpf->len; /* Q: is this needed? */
   452		xdpf->len   += vi->hdr_len;
   453	
   454		sg_init_one(sq->sg, xdpf->data, xdpf->len);
   455	
   456		err = virtqueue_add_outbuf(sq->vq, sq->sg, 1, xdpf, GFP_ATOMIC);
   457		if (unlikely(err))
   458			return false; /* Caller handle free/refcnt */
   459	
   460		return true;
   461	}
   462	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ