netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anirudh Rayabharam <mail@anirudhrb.com>
To: syzbot <syzbot+0abd373e2e50d704db87@syzkaller.appspotmail.com>
Cc: jasowang@redhat.com, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org, mst@redhat.com,
	netdev@vger.kernel.org, syzkaller-bugs@googlegroups.com,
	virtualization@lists.linux-foundation.org
Subject: Re: [syzbot] INFO: task hung in vhost_work_dev_flush
Date: Mon, 21 Feb 2022 23:57:11 +0530	[thread overview]
Message-ID: <YhPZf7qHeOWHgTHe@anirudhrb.com> (raw)
In-Reply-To: <00000000000057702a05d8532b18@google.com>

#syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master

diff --git a/drivers/vhost/iotlb.c b/drivers/vhost/iotlb.c
index 670d56c879e5..fef9daa9f09f 100644
--- a/drivers/vhost/iotlb.c
+++ b/drivers/vhost/iotlb.c
@@ -53,8 +53,13 @@ int vhost_iotlb_add_range_ctx(struct vhost_iotlb *iotlb,
 			      void *opaque)
 {
 	struct vhost_iotlb_map *map;
+	u64 size = last - start + 1;
 
-	if (last < start)
+	pr_info("vhost_iotlb_add_range: iotlb=%p, start=%llu, last=%llx, addr=%llu\n",
+			iotlb, start, last, addr);
+
+	// size can overflow to 0 when start is 0 and last is (2^64 - 1).
+	if (last < start || size == 0)
 		return -EFAULT;
 
 	if (iotlb->limit &&
@@ -69,7 +74,7 @@ int vhost_iotlb_add_range_ctx(struct vhost_iotlb *iotlb,
 		return -ENOMEM;
 
 	map->start = start;
-	map->size = last - start + 1;
+	map->size = size;
 	map->last = last;
 	map->addr = addr;
 	map->perm = perm;

  parent reply	other threads:[~2022-02-21 18:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-18 23:23 [syzbot] INFO: task hung in vhost_work_dev_flush syzbot
2022-02-21  8:15 ` Anirudh Rayabharam
2022-02-21 14:12 ` Stefano Garzarella
2022-02-21 14:37   ` syzbot
2022-02-21 15:53   ` Anirudh Rayabharam
2022-02-21 16:39     ` Stefano Garzarella
2022-02-22 10:05     ` Dan Carpenter
2022-02-22 11:34       ` Anirudh Rayabharam
2022-02-21 18:27 ` Anirudh Rayabharam [this message]
2022-02-21 18:40   ` syzbot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YhPZf7qHeOWHgTHe@anirudhrb.com \
    --to=mail@anirudhrb.com \
    --cc=jasowang@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=syzbot+0abd373e2e50d704db87@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).