staging: fsl-dpaa2: ethsw: Add missing netdevice check
Subsystems (3)
PATCH 1/1 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.
--- drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/staging/fsl-dpaa2/ethsw/ethsw.c +3 -0
@@ -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 ;
Signature · 1 line
2.17.1
Quoted 7 lines
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
Quoted 25 lines
Fixes 44baaa43d7cc ("staging: fsl-dpaa2/ethsw: Add Freescale DPAA2 EthernetSwitch driver")
Signed-off-by Florian Fainelli <[email protected]>--- drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 3 +++ 1 file changed, 3 insertions(+)drivers/staging/fsl- renamed from drivers/staging/fsl-dpaa2/ethsw/ethsw.c +0
-0
dpaa2/ethsw/ethsw.c
indexdaabaceeea52..2edd82f5229a100644drivers/staging/fsl-dpaa2/ethsw/ethsw.c +3
-0@@ -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
Le 2/23/19 à 12:45 AM, Ioana Ciornei a écrit :
Quoted 8 lines
Quoted 7 lines
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.
Quoted 4 lines
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/216I 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.
Signature · 1 line
Florian
Quoted 14 lines
Subject: Re: [PATCH net] staging: fsl-dpaa2: ethsw: Add missing netdevice check
Le 2/23/19 à 12:45 AM, Ioana Ciornei a écrit :
Quoted 10 lines
Quoted 8 lines
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
Quoted 8 lines
backed by the ethsw:
Quoted 3 lines
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