DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] net/failsafe: fix starting failsafe with invalid MAC
@ 2018-05-07 12:17 Raslan Darawsheh
  2018-05-09 11:46 ` Gaëtan Rivet
  0 siblings, 1 reply; 2+ messages in thread
From: Raslan Darawsheh @ 2018-05-07 12:17 UTC (permalink / raw)
  To: gaetan.rivet; +Cc: dev, matan, thomas, ophirmu, rasland

When starting failsafe with mac option, and giving it an invalid MAC. It
will cause a segmentation fault due to the hotplug_alarm installed on an
invalid subdev.

Fixes: a46f8d58 ("net/failsafe: add fail-safe PMD")
Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>
---
 drivers/net/failsafe/failsafe.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
index 5e7a8ba..3a747c2 100644
--- a/drivers/net/failsafe/failsafe.c
+++ b/drivers/net/failsafe/failsafe.c
@@ -226,7 +226,7 @@ fs_eth_dev_create(struct rte_vdev_device *vdev)
 							       mac);
 			if (ret) {
 				ERROR("Failed to set default MAC address");
-				goto free_args;
+				goto cancel_alarm;
 			}
 		}
 	} else {
@@ -260,6 +260,8 @@ fs_eth_dev_create(struct rte_vdev_device *vdev)
 		.type = RTE_INTR_HANDLE_EXT,
 	};
 	return 0;
+cancel_alarm:
+	failsafe_hotplug_alarm_cancel(dev);
 free_args:
 	failsafe_args_free(dev);
 free_subs:
-- 
2.7.4

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

* Re: [dpdk-dev] [PATCH] net/failsafe: fix starting failsafe with invalid MAC
  2018-05-07 12:17 [dpdk-dev] [PATCH] net/failsafe: fix starting failsafe with invalid MAC Raslan Darawsheh
@ 2018-05-09 11:46 ` Gaëtan Rivet
  0 siblings, 0 replies; 2+ messages in thread
From: Gaëtan Rivet @ 2018-05-09 11:46 UTC (permalink / raw)
  To: Raslan Darawsheh; +Cc: dev, matan, thomas, ophirmu

Hello Raslan,

Thank you for fixing this bug.

On Mon, May 07, 2018 at 03:17:15PM +0300, Raslan Darawsheh wrote:
> When starting failsafe with mac option, and giving it an invalid MAC. It
> will cause a segmentation fault due to the hotplug_alarm installed on an
> invalid subdev.
> 
> Fixes: a46f8d58 ("net/failsafe: add fail-safe PMD")

Only issue I have with this patch is that it should fix instead the commit

Fixes: ebea83f8 ("net/failsafe: add plug-in support")

Which introduced the alarm_install routine.

> Signed-off-by: Raslan Darawsheh <rasland@mellanox.com>

Otherwise:
Acked-by: Gaetan Rivet <gaetan.rivet@6wind.com>

> ---
>  drivers/net/failsafe/failsafe.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/failsafe/failsafe.c b/drivers/net/failsafe/failsafe.c
> index 5e7a8ba..3a747c2 100644
> --- a/drivers/net/failsafe/failsafe.c
> +++ b/drivers/net/failsafe/failsafe.c
> @@ -226,7 +226,7 @@ fs_eth_dev_create(struct rte_vdev_device *vdev)
>  							       mac);
>  			if (ret) {
>  				ERROR("Failed to set default MAC address");
> -				goto free_args;
> +				goto cancel_alarm;
>  			}
>  		}
>  	} else {
> @@ -260,6 +260,8 @@ fs_eth_dev_create(struct rte_vdev_device *vdev)
>  		.type = RTE_INTR_HANDLE_EXT,
>  	};
>  	return 0;
> +cancel_alarm:
> +	failsafe_hotplug_alarm_cancel(dev);
>  free_args:
>  	failsafe_args_free(dev);
>  free_subs:
> -- 
> 2.7.4
> 

Thanks,
-- 
Gaëtan Rivet
6WIND

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

end of thread, other threads:[~2018-05-09 11:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-07 12:17 [dpdk-dev] [PATCH] net/failsafe: fix starting failsafe with invalid MAC Raslan Darawsheh
2018-05-09 11:46 ` Gaëtan Rivet

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