All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net] staging: fsl-dpaa2: ethsw: Add missing netdevice check
@ 2019-02-22 22:02 Florian Fainelli
  2019-02-23  8:45 ` Ioana Ciornei
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Fainelli @ 2019-02-22 22:02 UTC (permalink / raw)
  To: netdev
  Cc: Florian Fainelli, Ioana Radulescu, Ioana Ciornei,
	Greg Kroah-Hartman, open list:DPAA2 ETHERNET SWITCH DRIVER,
	open list:STAGING SUBSYSTEM

port_switchdev_event() does not check that the target network device is
actually backed by the ethsw driver, this could be problematic in a
stacked environment case.

Fixes: 44baaa43d7cc ("staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet Switch driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
 drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
index daabaceeea52..2edd82f5229a 100644
--- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
+++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
@@ -1047,6 +1047,9 @@ static int port_switchdev_event(struct notifier_block *unused,
 	struct ethsw_switchdev_event_work *switchdev_work;
 	struct switchdev_notifier_fdb_info *fdb_info = ptr;
 
+	if (!ethsw_port_dev_check(dev))
+		return NOTIFY_DONE;
+
 	switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC);
 	if (!switchdev_work)
 		return NOTIFY_BAD;
-- 
2.17.1


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

* RE: [PATCH net] staging: fsl-dpaa2: ethsw: Add missing netdevice check
  2019-02-22 22:02 [PATCH net] staging: fsl-dpaa2: ethsw: Add missing netdevice check Florian Fainelli
@ 2019-02-23  8:45 ` Ioana Ciornei
  2019-02-24 16:17   ` Florian Fainelli
  0 siblings, 1 reply; 4+ messages in thread
From: Ioana Ciornei @ 2019-02-23  8:45 UTC (permalink / raw)
  To: Florian Fainelli, netdev
  Cc: Ioana Ciocoi Radulescu, Greg Kroah-Hartman,
	open list:DPAA2 ETHERNET SWITCH DRIVER,
	open list:STAGING SUBSYSTEM


> Subject: [PATCH net] staging: fsl-dpaa2: ethsw: Add missing netdevice check
> 
> port_switchdev_event() does not check that the target network device is
> actually backed by the ethsw driver, this could be problematic in a stacked
> environment case.
> 

Just FYI, I sent a patch set containing a similar patch verifying if the netdev is backed by the ethsw:
https://lkml.org/lkml/2019/2/6/216

I sent the entire patch set against the staging tree.

Ioana C

> Fixes: 44baaa43d7cc ("staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 Ethernet
> Switch driver")
> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
> ---
>  drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c b/drivers/staging/fsl-
> dpaa2/ethsw/ethsw.c
> index daabaceeea52..2edd82f5229a 100644
> --- a/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
> +++ b/drivers/staging/fsl-dpaa2/ethsw/ethsw.c
> @@ -1047,6 +1047,9 @@ static int port_switchdev_event(struct notifier_block
> *unused,
>  	struct ethsw_switchdev_event_work *switchdev_work;
>  	struct switchdev_notifier_fdb_info *fdb_info = ptr;
> 
> +	if (!ethsw_port_dev_check(dev))
> +		return NOTIFY_DONE;
> +
>  	switchdev_work = kzalloc(sizeof(*switchdev_work), GFP_ATOMIC);
>  	if (!switchdev_work)
>  		return NOTIFY_BAD;
> --
> 2.17.1


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

* Re: [PATCH net] staging: fsl-dpaa2: ethsw: Add missing netdevice check
  2019-02-23  8:45 ` Ioana Ciornei
@ 2019-02-24 16:17   ` Florian Fainelli
  2019-02-25  9:43     ` Ioana Ciornei
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Fainelli @ 2019-02-24 16:17 UTC (permalink / raw)
  To: Ioana Ciornei, netdev
  Cc: Ioana Ciocoi Radulescu, Greg Kroah-Hartman,
	open list:DPAA2 ETHERNET SWITCH DRIVER,
	open list:STAGING SUBSYSTEM

Le 2/23/19 à 12:45 AM, Ioana Ciornei a écrit :
> 
>> Subject: [PATCH net] staging: fsl-dpaa2: ethsw: Add missing netdevice check
>>
>> port_switchdev_event() does not check that the target network device is
>> actually backed by the ethsw driver, this could be problematic in a stacked
>> environment case.
>>
> 
> Just FYI, I sent a patch set containing a similar patch verifying if the netdev is backed by the ethsw:
> https://lkml.org/lkml/2019/2/6/216
> 
> I sent the entire patch set against the staging tree.

Thank you. BTW do you have any plans for moving this driver out of
staging? It looks pretty good to me to get promoted in tree, provided
that you also have all the dependencies in place etc.
-- 
Florian

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

* RE: [PATCH net] staging: fsl-dpaa2: ethsw: Add missing netdevice check
  2019-02-24 16:17   ` Florian Fainelli
@ 2019-02-25  9:43     ` Ioana Ciornei
  0 siblings, 0 replies; 4+ messages in thread
From: Ioana Ciornei @ 2019-02-25  9:43 UTC (permalink / raw)
  To: Florian Fainelli, netdev
  Cc: Ioana Ciocoi Radulescu, Greg Kroah-Hartman,
	open list:DPAA2 ETHERNET SWITCH DRIVER,
	open list:STAGING SUBSYSTEM


> Subject: Re: [PATCH net] staging: fsl-dpaa2: ethsw: Add missing netdevice check
> 
> Le 2/23/19 à 12:45 AM, Ioana Ciornei a écrit :
> >
> >> Subject: [PATCH net] staging: fsl-dpaa2: ethsw: Add missing netdevice
> >> check
> >>
> >> port_switchdev_event() does not check that the target network device
> >> is actually backed by the ethsw driver, this could be problematic in
> >> a stacked environment case.
> >>
> >
> > Just FYI, I sent a patch set containing a similar patch verifying if the netdev is
> backed by the ethsw:
> > https://lkml.org/lkml/2019/2/6/216
> >
> > I sent the entire patch set against the staging tree.
> 
> Thank you. BTW do you have any plans for moving this driver out of staging? It
> looks pretty good to me to get promoted in tree, provided that you also have all
> the dependencies in place etc.

Driver dependencies such as the fsl-mc bus or the dpio driver are out of staging but not all the TODO items are yet implemented (most notably support for control traffic).
Do you think maybe we can move it now and submit directly to the netdev tree the other features?

Ioana C

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

end of thread, other threads:[~2019-02-25  9:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-22 22:02 [PATCH net] staging: fsl-dpaa2: ethsw: Add missing netdevice check Florian Fainelli
2019-02-23  8:45 ` Ioana Ciornei
2019-02-24 16:17   ` Florian Fainelli
2019-02-25  9:43     ` Ioana Ciornei

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.