vringh: Use wiov->used to check for read/write desc order
Subsystems (4)
PATCH 1/1 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 <[email protected]>
--- drivers/vhost/vringh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/vhost/vringh.c +1 -1
@@ -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 ;
Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Quoted 5 lines · Neeraj Upadhyay
As
iov->usedis incremented when descriptors are processed in__vringh_iov(), use it to check for incorrect read and write descriptor order.Signed-off-by Neeraj Upadhyay <[email protected]>
Acked-by Jason Wang <[email protected]>
Quoted 17 lines
--- drivers/vhost/vringh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/vhost/vringh.c +1
-1@@ -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 ;
Quoted 8 lines · Neeraj Upadhyay
As
iov->usedis incremented when descriptors are processed in__vringh_iov(), use it to check for incorrect read and write descriptor order.Signed-off-by Neeraj Upadhyay <[email protected]>---
drivers/vhost/vringh.c| 2 +-1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by Stefano Garzarella <[email protected]>
Quoted 18 lines
drivers/vhost/vringh.c +1
-1@@ -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 ;Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation
Michael S. Tsirkin
maintainerQuoted 3 lines · Neeraj Upadhyay
As
iov->usedis incremented when descriptors are processed in__vringh_iov(), use it to check for incorrect read and write descriptor order.
Could the commit log be clearer? why is wiov->i incorrect here?
Quoted 21 lines
Signed-off-by Neeraj Upadhyay <[email protected]>--- drivers/vhost/vringh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/vhost/vringh.c +1
-1@@ -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 ;Signature · 2 lines
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, hosted by The Linux Foundation