patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH v2] vhost: add sanity check when operating the split ring
       [not found] <20210827051241.2448098-1-fengli@smartx.com>
@ 2021-10-14 12:40 ` Li Feng
  2021-10-15  8:51   ` [dpdk-stable] [dpdk-dev] " Maxime Coquelin
  0 siblings, 1 reply; 4+ messages in thread
From: Li Feng @ 2021-10-14 12:40 UTC (permalink / raw)
  To: Maxime Coquelin, Chenbo Xia, Lin Li, Jin Yu, Yu Zhang, Xun Ni
  Cc: dev, Li Feng, stable

The idx in rte_vhost_set_last_inflight_io_split is from the frontend
driver, check if it's in the virtqueue range.

Fixes: bb0c2de9602b ("vhost: add APIs to operate inflight ring")
Cc: stable@dpdk.org

Signed-off-by: Li Feng <fengli@smartx.com>
---
 lib/vhost/vhost.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
index 9540522dac..3b674ac320 100644
--- a/lib/vhost/vhost.c
+++ b/lib/vhost/vhost.c
@@ -1226,6 +1226,9 @@ rte_vhost_set_last_inflight_io_split(int vid, uint16_t vring_idx,
 	if (unlikely(!vq->inflight_split))
 		return -1;
 
+	if (unlikely(idx >= vq->size))
+		return -1;
+
 	vq->inflight_split->last_inflight_io = idx;
 	return 0;
 }
-- 
2.31.1


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

* Re: [dpdk-stable] [dpdk-dev] [PATCH v2] vhost: add sanity check when operating the split ring
  2021-10-14 12:40 ` [dpdk-stable] [PATCH v2] vhost: add sanity check when operating the split ring Li Feng
@ 2021-10-15  8:51   ` Maxime Coquelin
  2021-10-15  9:25     ` Li Feng
  0 siblings, 1 reply; 4+ messages in thread
From: Maxime Coquelin @ 2021-10-15  8:51 UTC (permalink / raw)
  To: Li Feng, Chenbo Xia, Lin Li, Jin Yu, Yu Zhang, Xun Ni; +Cc: dev, stable

The title is too vague, I would put something like:

vhost: add sanity check on inflight last index

On 10/14/21 14:40, Li Feng wrote:
> The idx in rte_vhost_set_last_inflight_io_split is from the frontend

s/idx/index/

> driver, check if it's in the virtqueue range.
> 
> Fixes: bb0c2de9602b ("vhost: add APIs to operate inflight ring")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Li Feng <fengli@smartx.com>
> ---
>   lib/vhost/vhost.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
> index 9540522dac..3b674ac320 100644
> --- a/lib/vhost/vhost.c
> +++ b/lib/vhost/vhost.c
> @@ -1226,6 +1226,9 @@ rte_vhost_set_last_inflight_io_split(int vid, uint16_t vring_idx,
>   	if (unlikely(!vq->inflight_split))
>   		return -1;
>   
> +	if (unlikely(idx >= vq->size))
> +		return -1;
> +
>   	vq->inflight_split->last_inflight_io = idx;
>   	return 0;
>   }
> 

Other than that, this is fine to me:

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

If my suggestions are fine for you, I can fix while applying.

Thanks,
Maxime


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

* Re: [dpdk-stable] [dpdk-dev] [PATCH v2] vhost: add sanity check when operating the split ring
  2021-10-15  8:51   ` [dpdk-stable] [dpdk-dev] " Maxime Coquelin
@ 2021-10-15  9:25     ` Li Feng
  2021-10-21 12:32       ` Maxime Coquelin
  0 siblings, 1 reply; 4+ messages in thread
From: Li Feng @ 2021-10-15  9:25 UTC (permalink / raw)
  To: Maxime Coquelin; +Cc: Chenbo Xia, Lin Li, Jin Yu, Yu Zhang, Xun Ni, dev, stable

On Fri, Oct 15, 2021 at 4:52 PM Maxime Coquelin
<maxime.coquelin@redhat.com> wrote:
>
> The title is too vague, I would put something like:
>
> vhost: add sanity check on inflight last index
>
> On 10/14/21 14:40, Li Feng wrote:
> > The idx in rte_vhost_set_last_inflight_io_split is from the frontend
>
> s/idx/index/
>
> > driver, check if it's in the virtqueue range.
> >
> > Fixes: bb0c2de9602b ("vhost: add APIs to operate inflight ring")
> > Cc: stable@dpdk.org
> >
> > Signed-off-by: Li Feng <fengli@smartx.com>
> > ---
> >   lib/vhost/vhost.c | 3 +++
> >   1 file changed, 3 insertions(+)
> >
> > diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
> > index 9540522dac..3b674ac320 100644
> > --- a/lib/vhost/vhost.c
> > +++ b/lib/vhost/vhost.c
> > @@ -1226,6 +1226,9 @@ rte_vhost_set_last_inflight_io_split(int vid, uint16_t vring_idx,
> >       if (unlikely(!vq->inflight_split))
> >               return -1;
> >
> > +     if (unlikely(idx >= vq->size))
> > +             return -1;
> > +
> >       vq->inflight_split->last_inflight_io = idx;
> >       return 0;
> >   }
> >
>
> Other than that, this is fine to me:
>
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>
> If my suggestions are fine for you, I can fix while applying.
>
It's fine.

> Thanks,
> Maxime
>

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

* Re: [dpdk-stable] [dpdk-dev] [PATCH v2] vhost: add sanity check when operating the split ring
  2021-10-15  9:25     ` Li Feng
@ 2021-10-21 12:32       ` Maxime Coquelin
  0 siblings, 0 replies; 4+ messages in thread
From: Maxime Coquelin @ 2021-10-21 12:32 UTC (permalink / raw)
  To: Li Feng; +Cc: Chenbo Xia, Lin Li, Jin Yu, Yu Zhang, Xun Ni, dev, stable



On 10/15/21 11:25, Li Feng wrote:
> On Fri, Oct 15, 2021 at 4:52 PM Maxime Coquelin
> <maxime.coquelin@redhat.com> wrote:
>>
>> The title is too vague, I would put something like:
>>
>> vhost: add sanity check on inflight last index
>>
>> On 10/14/21 14:40, Li Feng wrote:
>>> The idx in rte_vhost_set_last_inflight_io_split is from the frontend
>>
>> s/idx/index/
>>
>>> driver, check if it's in the virtqueue range.
>>>
>>> Fixes: bb0c2de9602b ("vhost: add APIs to operate inflight ring")
>>> Cc: stable@dpdk.org
>>>
>>> Signed-off-by: Li Feng <fengli@smartx.com>
>>> ---
>>>    lib/vhost/vhost.c | 3 +++
>>>    1 file changed, 3 insertions(+)
>>>
>>> diff --git a/lib/vhost/vhost.c b/lib/vhost/vhost.c
>>> index 9540522dac..3b674ac320 100644
>>> --- a/lib/vhost/vhost.c
>>> +++ b/lib/vhost/vhost.c
>>> @@ -1226,6 +1226,9 @@ rte_vhost_set_last_inflight_io_split(int vid, uint16_t vring_idx,
>>>        if (unlikely(!vq->inflight_split))
>>>                return -1;
>>>
>>> +     if (unlikely(idx >= vq->size))
>>> +             return -1;
>>> +
>>>        vq->inflight_split->last_inflight_io = idx;
>>>        return 0;
>>>    }
>>>
>>
>> Other than that, this is fine to me:
>>
>> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>>
>> If my suggestions are fine for you, I can fix while applying.
>>
> It's fine.
> 
>> Thanks,
>> Maxime
>>
> 

Applied to dpdk-next-virtio/main.

Thanks,
Maxime


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

end of thread, other threads:[~2021-10-21 12:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20210827051241.2448098-1-fengli@smartx.com>
2021-10-14 12:40 ` [dpdk-stable] [PATCH v2] vhost: add sanity check when operating the split ring Li Feng
2021-10-15  8:51   ` [dpdk-stable] [dpdk-dev] " Maxime Coquelin
2021-10-15  9:25     ` Li Feng
2021-10-21 12:32       ` Maxime Coquelin

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git