* [dpdk-dev] [PATCH] net/virtio: Fix crash in virtio_dev_free_mbufs
@ 2018-02-03 14:55 David C Harton
2018-02-05 8:17 ` Olivier Matz
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: David C Harton @ 2018-02-03 14:55 UTC (permalink / raw)
To: yliu, maxime.coquelin, tiwei.bie; +Cc: dev, David C Harton, olivier.matz
virtio_dev_free_mbufs was recently modified to free the
virtqueues but failed to check whether the array was
allocated. Added a check to ensure vqs was non-null.
Fixes: bdb32afbb610 ("net/virtio: rationalize queue flushing")
Cc: olivier.matz@6wind.com
Signed-off-by: David C Harton <dharton@cisco.com>
---
drivers/net/virtio/virtio_ethdev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
index 2082d6a..884f74a 100644
--- a/drivers/net/virtio/virtio_ethdev.c
+++ b/drivers/net/virtio/virtio_ethdev.c
@@ -1975,6 +1975,9 @@ static void virtio_dev_free_mbufs(struct rte_eth_dev *dev)
struct rte_mbuf *buf;
int queue_type;
+ if (hw->vqs == NULL)
+ return;
+
for (i = 0; i < nr_vq; i++) {
vq = hw->vqs[i];
if (!vq)
--
2.10.3.dirty
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] net/virtio: Fix crash in virtio_dev_free_mbufs
2018-02-03 14:55 [dpdk-dev] [PATCH] net/virtio: Fix crash in virtio_dev_free_mbufs David C Harton
@ 2018-02-05 8:17 ` Olivier Matz
2018-02-05 8:44 ` Maxime Coquelin
2018-02-05 18:52 ` Ferruh Yigit
2 siblings, 0 replies; 4+ messages in thread
From: Olivier Matz @ 2018-02-05 8:17 UTC (permalink / raw)
To: David C Harton; +Cc: yliu, maxime.coquelin, tiwei.bie, dev
On Sat, Feb 03, 2018 at 09:55:23AM -0500, David C Harton wrote:
> virtio_dev_free_mbufs was recently modified to free the
> virtqueues but failed to check whether the array was
> allocated. Added a check to ensure vqs was non-null.
>
> Fixes: bdb32afbb610 ("net/virtio: rationalize queue flushing")
> Cc: olivier.matz@6wind.com
>
> Signed-off-by: David C Harton <dharton@cisco.com>
> ---
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Thank you for this fix.
Out of curiosity, did you see the problem by code review or is there an
easy way to reproduce the crash?
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] net/virtio: Fix crash in virtio_dev_free_mbufs
2018-02-03 14:55 [dpdk-dev] [PATCH] net/virtio: Fix crash in virtio_dev_free_mbufs David C Harton
2018-02-05 8:17 ` Olivier Matz
@ 2018-02-05 8:44 ` Maxime Coquelin
2018-02-05 18:52 ` Ferruh Yigit
2 siblings, 0 replies; 4+ messages in thread
From: Maxime Coquelin @ 2018-02-05 8:44 UTC (permalink / raw)
To: David C Harton, yliu, tiwei.bie; +Cc: dev, olivier.matz
On 02/03/2018 03:55 PM, David C Harton wrote:
> virtio_dev_free_mbufs was recently modified to free the
> virtqueues but failed to check whether the array was
> allocated. Added a check to ensure vqs was non-null.
>
> Fixes: bdb32afbb610 ("net/virtio: rationalize queue flushing")
> Cc: olivier.matz@6wind.com
>
> Signed-off-by: David C Harton <dharton@cisco.com>
> ---
> drivers/net/virtio/virtio_ethdev.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c
> index 2082d6a..884f74a 100644
> --- a/drivers/net/virtio/virtio_ethdev.c
> +++ b/drivers/net/virtio/virtio_ethdev.c
> @@ -1975,6 +1975,9 @@ static void virtio_dev_free_mbufs(struct rte_eth_dev *dev)
> struct rte_mbuf *buf;
> int queue_type;
>
> + if (hw->vqs == NULL)
> + return;
> +
> for (i = 0; i < nr_vq; i++) {
> vq = hw->vqs[i];
> if (!vq)
>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [dpdk-dev] [PATCH] net/virtio: Fix crash in virtio_dev_free_mbufs
2018-02-03 14:55 [dpdk-dev] [PATCH] net/virtio: Fix crash in virtio_dev_free_mbufs David C Harton
2018-02-05 8:17 ` Olivier Matz
2018-02-05 8:44 ` Maxime Coquelin
@ 2018-02-05 18:52 ` Ferruh Yigit
2 siblings, 0 replies; 4+ messages in thread
From: Ferruh Yigit @ 2018-02-05 18:52 UTC (permalink / raw)
To: David C Harton, yliu, maxime.coquelin, tiwei.bie; +Cc: dev, olivier.matz
On 2/3/2018 2:55 PM, David C Harton wrote:
> virtio_dev_free_mbufs was recently modified to free the
> virtqueues but failed to check whether the array was
> allocated. Added a check to ensure vqs was non-null.
>
> Fixes: bdb32afbb610 ("net/virtio: rationalize queue flushing")
> Cc: olivier.matz@6wind.com
>
> Signed-off-by: David C Harton <dharton@cisco.com>
[1] Signed-off-by: David Harton <dharton@cisco.com>
Reviewed-by: Olivier Matz <olivier.matz@6wind.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Applied to dpdk-next-net/master, thanks.
[1]
Hi David,
Since your previous commits has "David Harton" name, to prevent seen as a new
person, I kept same name, fyi.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-02-05 18:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-03 14:55 [dpdk-dev] [PATCH] net/virtio: Fix crash in virtio_dev_free_mbufs David C Harton
2018-02-05 8:17 ` Olivier Matz
2018-02-05 8:44 ` Maxime Coquelin
2018-02-05 18:52 ` Ferruh Yigit
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).