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

* Re: [PATCH] vringh: Use wiov->used to check for read/write desc order
  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 16:10   ` Stefano Garzarella
  2021-06-23 20:09   ` Michael S. Tsirkin
  2 siblings, 0 replies; 7+ messages in thread
From: Jason Wang @ 2021-06-23  3:21 UTC (permalink / raw)
  To: Neeraj Upadhyay, mst; +Cc: virtualization, netdev, linux-kernel


在 2021/6/22 下午7:37, 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>


Acked-by: Jason Wang <jasowang@redhat.com>


> ---
>   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;


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

* Re: [PATCH] vringh: Use wiov->used to check for read/write desc order
@ 2021-06-23  3:21   ` Jason Wang
  0 siblings, 0 replies; 7+ messages in thread
From: Jason Wang @ 2021-06-23  3:21 UTC (permalink / raw)
  To: Neeraj Upadhyay, mst; +Cc: netdev, linux-kernel, virtualization


在 2021/6/22 下午7:37, 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>


Acked-by: Jason Wang <jasowang@redhat.com>


> ---
>   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;

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

* Re: [PATCH] vringh: Use wiov->used to check for read/write desc order
  2021-06-22 11:37 [PATCH] vringh: Use wiov->used to check for read/write desc order Neeraj Upadhyay
@ 2021-06-23 16:10   ` Stefano Garzarella
  2021-06-23 16:10   ` Stefano Garzarella
  2021-06-23 20:09   ` Michael S. Tsirkin
  2 siblings, 0 replies; 7+ messages in thread
From: Stefano Garzarella @ 2021-06-23 16:10 UTC (permalink / raw)
  To: Neeraj Upadhyay; +Cc: mst, jasowang, virtualization, netdev, linux-kernel

On Tue, Jun 22, 2021 at 05:07:53PM +0530, Neeraj Upadhyay wrote:
>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(-)

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

>
>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	[flat|nested] 7+ messages in thread

* Re: [PATCH] vringh: Use wiov->used to check for read/write desc order
@ 2021-06-23 16:10   ` Stefano Garzarella
  0 siblings, 0 replies; 7+ messages in thread
From: Stefano Garzarella @ 2021-06-23 16:10 UTC (permalink / raw)
  To: Neeraj Upadhyay; +Cc: netdev, virtualization, linux-kernel, mst

On Tue, Jun 22, 2021 at 05:07:53PM +0530, Neeraj Upadhyay wrote:
>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(-)

Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>

>
>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
>

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

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

* Re: [PATCH] vringh: Use wiov->used to check for read/write desc order
  2021-06-22 11:37 [PATCH] vringh: Use wiov->used to check for read/write desc order Neeraj Upadhyay
@ 2021-06-23 20:09   ` Michael S. Tsirkin
  2021-06-23 16:10   ` Stefano Garzarella
  2021-06-23 20:09   ` Michael S. Tsirkin
  2 siblings, 0 replies; 7+ messages in thread
From: Michael S. Tsirkin @ 2021-06-23 20:09 UTC (permalink / raw)
  To: Neeraj Upadhyay; +Cc: jasowang, virtualization, netdev, linux-kernel

On Tue, Jun 22, 2021 at 05:07:53PM +0530, Neeraj Upadhyay wrote:
> As iov->used is 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?

> 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	[flat|nested] 7+ messages in thread

* Re: [PATCH] vringh: Use wiov->used to check for read/write desc order
@ 2021-06-23 20:09   ` Michael S. Tsirkin
  0 siblings, 0 replies; 7+ messages in thread
From: Michael S. Tsirkin @ 2021-06-23 20:09 UTC (permalink / raw)
  To: Neeraj Upadhyay; +Cc: netdev, linux-kernel, virtualization

On Tue, Jun 22, 2021 at 05:07:53PM +0530, Neeraj Upadhyay wrote:
> As iov->used is 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?

> 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

_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization

^ permalink raw reply	[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.