1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/net/ethernet/microchip/lan966x
Shang XiaoJing ba86af3733 net: lan966x: Fix potential null-ptr-deref in lan966x_stats_init()
lan966x_stats_init() calls create_singlethread_workqueue() and not
checked the ret value, which may return NULL. And a null-ptr-deref may
happen:

lan966x_stats_init()
    create_singlethread_workqueue() # failed, lan966x->stats_queue is NULL
    queue_delayed_work()
        queue_delayed_work_on()
            __queue_delayed_work()  # warning here, but continue
                __queue_work()      # access wq->flags, null-ptr-deref

Check the ret value and return -ENOMEM if it is NULL.

Fixes: 12c2d0a5b8 ("net: lan966x: add ethtool configuration and statistics")
Signed-off-by: Shang XiaoJing <shangxiaojing@huawei.com>
Reviewed-by: Horatiu Vultur <horatiu.vultur@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-11-16 09:10:29 +00:00
..
Kconfig net: lan966x: Add lag support for lan966x 2022-08-22 14:00:54 +01:00
lan966x_cbs.c net: lan966x: Add offload support for cbs 2022-09-28 09:36:28 +01:00
lan966x_ethtool.c net: lan966x: Fix potential null-ptr-deref in lan966x_stats_init() 2022-11-16 09:10:29 +00:00
lan966x_ets.c net: lan966x: Add offload support for ets 2022-09-28 09:36:28 +01:00
lan966x_fdb.c net: lan966x: Extend FDB to support also lag 2022-08-22 14:00:54 +01:00
lan966x_fdma.c net: lan966x: Fix unmapping of received frames using FDMA 2022-11-01 21:20:30 -07:00
lan966x_ifh.h net: lan966x: add port module support 2021-11-29 12:58:38 +00:00
lan966x_lag.c net: lan966x: Extend MAC to support also lag interfaces. 2022-08-22 14:00:54 +01:00
lan966x_mac.c net: lan966x: Extend MAC to support also lag interfaces. 2022-08-22 14:00:54 +01:00
lan966x_main.c net: lan966x: Fix FDMA when MTU is changed 2022-11-01 21:18:16 -07:00
lan966x_main.h net: lan966x: Fix the MTU calculation 2022-11-01 21:18:16 -07:00
lan966x_mdb.c net: lan966x: Update mdb when enabling/disabling mcast_snooping 2022-02-05 15:00:43 +00:00
lan966x_mirror.c net: lan966x: Add port mirroring support using tc-matchall 2022-10-03 12:46:46 +01:00
lan966x_mqprio.c net: lan966x: Fix spelling mistake "tarffic" -> "traffic" 2022-09-30 12:34:01 +01:00
lan966x_phylink.c net: lan966x: Extend lan966x with RGMII support 2022-09-06 10:00:28 +02:00
lan966x_police.c net: lan966x: Add port police support using tc-matchall 2022-10-03 12:46:46 +01:00
lan966x_port.c net: lan966x: Add offload support for taprio 2022-09-23 12:31:27 +01:00
lan966x_ptp.c net: lan966x: Add offload support for taprio 2022-09-23 12:31:27 +01:00
lan966x_regs.h net: lan966x: Adjust maximum frame size when vlan is enabled/disabled 2022-11-01 21:18:16 -07:00
lan966x_switchdev.c net: lan966x: Extend FDB to support also lag 2022-08-22 14:00:54 +01:00
lan966x_taprio.c net: lan966x: Add offload support for taprio 2022-09-23 12:31:27 +01:00
lan966x_tbf.c net: lan966x: Add offload support for tbf 2022-09-28 09:36:28 +01:00
lan966x_tc.c net: lan966x: Add port police support using tc-matchall 2022-10-03 12:46:46 +01:00
lan966x_tc_matchall.c net: lan966x: Add port mirroring support using tc-matchall 2022-10-03 12:46:46 +01:00
lan966x_vlan.c net: lan966x: Adjust maximum frame size when vlan is enabled/disabled 2022-11-01 21:18:16 -07:00
Makefile net: lan966x: Add port mirroring support using tc-matchall 2022-10-03 12:46:46 +01:00