Hi Arseny,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on vhost/linux-next]
[also build test WARNING on tip/perf/core linus/master v5.12-rc7]
[cannot apply to next-20210413]
[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/Arseny-Krasnov/virtio-vsock-intr...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git linux-next
config: x86_64-randconfig-s021-20210413 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.3-280-g2cd6d34e-dirty
#
https://github.com/0day-ci/linux/commit/c5fe1745b6ed6bc01a7f88737bd43fce7...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Arseny-Krasnov/virtio-vsock-introduce-SOCK_SEQPACKET-support/20210413-205228
git checkout c5fe1745b6ed6bc01a7f88737bd43fce70349367
# save the attached .config to linux build tree
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
> net/vmw_vsock/virtio_transport_common.c:441:37: sparse: sparse:
restricted __le32 degrades to integer
net/vmw_vsock/virtio_transport_common.c:450:23: sparse: sparse: context imbalance in
'virtio_transport_seqpacket_do_dequeue' - unexpected unlock
vim +441 net/vmw_vsock/virtio_transport_common.c
395
396 static int virtio_transport_seqpacket_do_dequeue(struct vsock_sock *vsk,
397 struct msghdr *msg,
398 int flags,
399 bool *msg_ready)
400 {
401 struct virtio_vsock_sock *vvs = vsk->trans;
402 struct virtio_vsock_pkt *pkt;
403 int err = 0;
404 size_t user_buf_len = msg->msg_iter.count;
405
406 *msg_ready = false;
407 spin_lock_bh(&vvs->rx_lock);
408
409 while (!*msg_ready && !list_empty(&vvs->rx_queue) && err
>= 0) {
410 pkt = list_first_entry(&vvs->rx_queue, struct virtio_vsock_pkt, list);
411
412 if (le16_to_cpu(pkt->hdr.op) == VIRTIO_VSOCK_OP_RW) {
413 size_t bytes_to_copy;
414 size_t pkt_len;
415
416 pkt_len = (size_t)le32_to_cpu(pkt->hdr.len);
417 bytes_to_copy = min(user_buf_len, pkt_len);
418
419 /* sk_lock is held by caller so no one else can dequeue.
420 * Unlock rx_lock since memcpy_to_msg() may sleep.
421 */
422 spin_unlock_bh(&vvs->rx_lock);
423
424 if (memcpy_to_msg(msg, pkt->buf, bytes_to_copy)) {
425 err = -EINVAL;
426 break;
427 }
428
429 spin_lock_bh(&vvs->rx_lock);
430
431 /* If user sets 'MSG_TRUNC' we return real length
432 * of message.
433 */
434 if (flags & MSG_TRUNC)
435 err += pkt_len;
436 else
437 err += bytes_to_copy;
438
439 user_buf_len -= bytes_to_copy;
440
441 if (pkt->hdr.flags & VIRTIO_VSOCK_SEQ_EOR)
442 *msg_ready = true;
443 }
444
445 virtio_transport_dec_rx_pkt(vvs, pkt);
446 list_del(&pkt->list);
447 virtio_transport_free_pkt(pkt);
448 }
449
450 spin_unlock_bh(&vvs->rx_lock);
451
452 virtio_transport_send_credit_update(vsk);
453
454 return err;
455 }
456
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org