linux/drivers/net/dsa/ocelot
David Yang ea07514700 net: mscc: ocelot: validate netdev belongs to switch in .netdev_to_port()
The .netdev_to_port() currently takes only a net_device and returns the
port index, without verifying the netdev actually belongs to the switch
being operated on. This can cause flower rule parsing to silently
resolve to a wrong port on the local hardware.

Update both implementations felix_netdev_to_port() and
ocelot_netdev_to_port() to validate ownership. Also update the callers
in ocelot_flower.c to pass through the ocelot context.

Signed-off-by: David Yang <mmyangfl@gmail.com>
Link: https://patch.msgid.link/20260606125247.305167-1-mmyangfl@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
History 2026-06-09 17:54:34 -07:00
..
felix.c net: mscc: ocelot: validate netdev belongs to switch in .netdev_to_port() 2026-06-09 17:54:34 -07:00
felix.h net: mscc: ocelot: validate netdev belongs to switch in .netdev_to_port() 2026-06-09 17:54:34 -07:00
felix_vsc9959.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Kconfig net: dsa: ocelot: fix selecting MFD_OCELOT 2023-02-16 13:03:15 +01:00
Makefile net: dsa: ocelot: add external ocelot switch control 2023-01-30 21:07:21 -08:00
ocelot_ext.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
seville_vsc9953.c net: dsa: Switch back to struct platform_driver::remove() 2024-10-04 16:39:57 -07:00