All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vringh: Use wiov->used to check for read/write desc order
@ 2021-06-22 11:37 Neeraj Upadhyay
  2021-06-23  3:21   ` Jason Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Neeraj Upadhyay @ 2021-06-22 11:37 UTC (permalink / raw)
  To: mst, jasowang; +Cc: virtualization, netdev, linux-kernel, Neeraj Upadhyay

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@codeaurora.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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-06-23 20:10 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22 11:37 [PATCH] vringh: Use wiov->used to check for read/write desc order Neeraj Upadhyay
2021-06-23  3:21 ` Jason Wang
2021-06-23  3:21   ` Jason Wang
2021-06-23 16:10 ` Stefano Garzarella
2021-06-23 16:10   ` Stefano Garzarella
2021-06-23 20:09 ` Michael S. Tsirkin
2021-06-23 20:09   ` Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.