WSL2-Linux-Kernel/drivers/net/ethernet
Vladimir Oltean 289d0822be net: dpaa: avoid on-stack arrays of NR_CPUS elements
[ Upstream commit 555a05d84ca2c587e2d4777006e2c2fb3dfbd91d ]

The dpaa-eth driver is written for PowerPC and Arm SoCs which have 1-24
CPUs. It depends on CONFIG_NR_CPUS having a reasonably small value in
Kconfig. Otherwise, there are 2 functions which allocate on-stack arrays
of NR_CPUS elements, and these can quickly explode in size, leading to
warnings such as:

  drivers/net/ethernet/freescale/dpaa/dpaa_eth.c:3280:12: warning:
  stack frame size (16664) exceeds limit (2048) in 'dpaa_eth_probe' [-Wframe-larger-than]

The problem is twofold:
- Reducing the array size to the boot-time num_possible_cpus() (rather
  than the compile-time NR_CPUS) creates a variable-length array,
  which should be avoided in the Linux kernel.
- Using NR_CPUS as an array size makes the driver blow up in stack
  consumption with generic, as opposed to hand-crafted, .config files.

A simple solution is to use dynamic allocation for num_possible_cpus()
elements (aka a small number determined at runtime).

Link: https://lore.kernel.org/all/202406261920.l5pzM1rj-lkp@intel.com/
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Breno Leitao <leitao@debian.org>
Acked-by: Madalin Bucur <madalin.bucur@oss.nxp.com>
Link: https://patch.msgid.link/20240713225336.1746343-2-vladimir.oltean@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-09-12 11:07:49 +02:00
..
3com 3c589_cs: Fix an error handling path in tc589_probe() 2023-05-30 13:55:33 +01:00
8390
actions ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
adaptec ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
aeroflex
agere ethernet: use eth_hw_addr_set() instead of ether_addr_copy() 2023-07-27 08:46:59 +02:00
alacritech ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
allwinner ethernet: use of_get_ethdev_address() 2023-07-27 08:47:00 +02:00
alteon ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
altera ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
amazon net: ena: Fix DMA syncing in XDP path when SWIOTLB is on 2024-06-16 13:39:53 +02:00
amd ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
apm ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
apple ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
aquantia ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
arc ethernet: use of_get_ethdev_address() 2023-07-27 08:47:00 +02:00
atheros ethernet: atheros: fix a memleak in atl1e_setup_ring_resources 2024-01-05 15:13:29 +01:00
broadcom bnx2x: Fix multiple UBSAN array-index-out-of-bounds 2024-07-18 13:07:34 +02:00
brocade bna: adjust 'name' buf size of bna_tcb and bna_ccb structures 2024-08-19 05:44:59 +02:00
cadence ethernet: use of_get_ethdev_address() 2023-07-27 08:47:00 +02:00
calxeda ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
cavium liquidio: Adjust a NULL pointer handling path in lio_vf_rep_copy_packet 2024-07-05 09:14:18 +02:00
chelsio cxgb4: add forgotten u64 ivlan cast before shift 2024-09-04 13:23:36 +02:00
cirrus
cisco enic: Validate length of nl attributes in enic_set_vf_port 2024-06-16 13:39:50 +02:00
cortina net: ethernet: cortina: Locking fixes 2024-06-16 13:39:25 +02:00
davicom
dec
dlink ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
emulex ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
ezchip ethernet: use of_get_ethdev_address() 2023-07-27 08:47:00 +02:00
faraday ethernet: use eth_hw_addr_set() instead of ether_addr_copy() 2023-07-27 08:46:59 +02:00
freescale net: dpaa: avoid on-stack arrays of NR_CPUS elements 2024-09-12 11:07:49 +02:00
fujitsu
google gve: Fix an edge case for TSO skb validity check 2024-08-19 05:45:17 +02:00
hisilicon net: hns3: add checking for vf id of mailbox 2024-09-04 13:23:27 +02:00
huawei
i825xx net/sun3_82586: Avoid reading past buffer in debug output 2024-09-04 13:23:24 +02:00
ibm ibmvnic: Free any outstanding tx skbs during scrq reset 2024-07-05 09:14:41 +02:00
intel ice: check ICE_VSI_DOWN under rtnl_lock when preparing for reset 2024-09-12 11:07:47 +02:00
litex ethernet: use of_get_ethdev_address() 2023-07-27 08:47:00 +02:00
marvell net: mvpp2: Don't re-use loop iterator 2024-08-19 05:45:32 +02:00
mediatek net: ethernet: mtk-star-emac: set mac_managed_pm when probing 2024-07-18 13:07:38 +02:00
mellanox mlxbf_gige: disable RX filters until RX path initialized 2024-09-04 13:23:19 +02:00
micrel net: ks8851: Fix potential TX stall after interface reopen 2024-07-18 13:07:40 +02:00
microchip net: sparx5: fix wrong config being used when reconfiguring PCS 2024-04-17 11:15:15 +02:00
microsoft net: mana: Fix race of mana_hwc_post_rx_wqe and new hwc response 2024-09-04 13:23:38 +02:00
moxa
mscc ethernet: use eth_hw_addr_set() instead of ether_addr_copy() 2023-07-27 08:46:59 +02:00
myricom ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
natsemi net/sonic: use dma_mapping_error() for error check 2023-03-30 12:47:48 +02:00
neterion ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
netronome nfp: flower: handle acti_netdevs allocation failure 2024-03-26 18:21:23 -04:00
ni nixge: fix mac address error handling again 2023-07-27 08:47:05 +02:00
nvidia eth: remove remaining copies of the NAPI_POLL_WEIGHT define 2023-10-19 23:05:39 +02:00
nxp ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
oki-semi
packetengines
pasemi net: pasemi: Fix return type of pasemi_mac_start_tx() 2023-05-24 17:36:45 +01:00
pensando ionic: fix potential irq name truncation 2024-09-12 11:07:41 +02:00
qlogic qed: avoid truncating work queue length 2024-06-16 13:39:18 +02:00
qualcomm qca_spi: Make interrupt remembering atomic 2024-07-05 09:14:30 +02:00
rdc ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
realtek r8169: don't increment tx_dropped in case of NETDEV_TX_BUSY 2024-08-19 05:45:34 +02:00
renesas net: ravb: Always process TX descriptor ring 2024-04-10 16:19:41 +02:00
rocker
samsung ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
seeq
sfc sfc: fix a double-free bug in efx_probe_filters 2024-01-15 18:51:15 +01:00
sgi
silan
sis ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
smsc net: smc91x: Fix m68k kernel compilation for ColdFire CPU 2024-06-16 13:39:12 +02:00
socionext net: netsec: Ignore 'phy-mode' on SynQuacer in DT mode 2023-08-11 15:13:53 +02:00
stmicro net: stmmac: Enable mac_managed_pm phylink config 2024-08-19 05:45:50 +02:00
sun eth: sungem: remove .ndo_poll_controller to avoid deadlocks 2024-06-16 13:39:25 +02:00
synopsys ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
tehuti
ti net: ethernet: ti: am65-cpts: Fix PTPv1 message type on TX packets 2024-05-02 16:24:46 +02:00
toshiba ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
tundra
via
wiznet
xilinx net: xilinx: axienet: Fix dangling multicast addresses 2024-09-04 13:23:34 +02:00
xircom ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
xscale
Kconfig
Makefile
dnet.c ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
dnet.h
ec_bhf.c
ethoc.c ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
fealnx.c ethernet: constify references to netdev->dev_addr in drivers 2024-01-05 15:13:37 +01:00
jme.c
jme.h
korina.c net: korina: handle clk prepare error in korina_probe() 2023-08-11 15:13:53 +02:00
lantiq_etop.c net: ethernet: lantiq_etop: fix double free in detach 2024-07-18 13:07:38 +02:00
lantiq_xrx200.c ethernet: use of_get_ethdev_address() 2023-07-27 08:47:00 +02:00