[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1624361873-6097-1-git-send-email-neeraju@codeaurora.org>
Date: Tue, 22 Jun 2021 17:07:53 +0530
From: Neeraj Upadhyay <neeraju@...eaurora.org>
To: mst@...hat.com, jasowang@...hat.com
Cc: virtualization@...ts.linux-foundation.org, netdev@...r.kernel.org,
linux-kernel@...r.kernel.org,
Neeraj Upadhyay <neeraju@...eaurora.org>
Subject: [PATCH] vringh: Use wiov->used to check for read/write desc order
As iov->used is incremented when descriptors are processed
in __vringh_iov(), use it to check for incorrect read
and write descriptor order.
Signed-off-by: Neeraj Upadhyay <neeraju@...eaurora.org>
---
drivers/vhost/vringh.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c
index 4af8fa2..14e2043 100644
--- a/drivers/vhost/vringh.c
+++ b/drivers/vhost/vringh.c
@@ -359,7 +359,7 @@ __vringh_iov(struct vringh *vrh, u16 i,
iov = wiov;
else {
iov = riov;
- if (unlikely(wiov && wiov->i)) {
+ if (unlikely(wiov && wiov->used)) {
vringh_bad("Readable desc %p after writable",
&descs[i]);
err = -EINVAL;
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation
Powered by blists - more mailing lists