linux/drivers/net/ethernet/mscc
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>
2026-06-09 17:54:34 -07:00
..
Kconfig
Makefile
ocelot_devlink.c
ocelot_fdma.c net: mscc: ocelot: fix QoS class for injected packets with "ocelot-8021q" 2024-08-16 09:59:32 +01:00
ocelot_fdma.h
ocelot_flower.c net: mscc: ocelot: validate netdev belongs to switch in .netdev_to_port() 2026-06-09 17:54:34 -07:00
ocelot_io.c net: mscc: ocelot: refactor enum ocelot_reg decoding to helper 2023-04-13 21:56:06 -07:00
ocelot_mm.c net: mscc: ocelot: fix oversize frame dropping for preemptible TCs 2023-07-06 19:10:22 -07:00
ocelot_mrp.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ocelot_net.c net: mscc: ocelot: validate netdev belongs to switch in .netdev_to_port() 2026-06-09 17:54:34 -07:00
ocelot_police.c
ocelot_police.h
ocelot_ptp.c net: dsa: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set() 2025-05-09 16:34:09 -07:00
ocelot_qs.h
ocelot_rew.h
ocelot_stats.c net: mscc: ocelot: Fix use-after-free caused by cyclic delayed work 2025-10-06 11:12:52 -07:00
ocelot_vcap.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ocelot_vcap.h net: mscc: ocelot: Remove unused declarations 2023-08-22 10:29:15 -07:00
ocelot_vsc7514.c net: ptp: introduce .supported_perout_flags to ptp_clock_info 2025-04-15 20:20:58 -07:00
ocelot.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
ocelot.h net: mscc: ocelot: validate netdev belongs to switch in .netdev_to_port() 2026-06-09 17:54:34 -07:00
vsc7514_regs.c net: mscc: ocelot: fix stat counter register values 2023-05-10 12:11:18 +01:00