linux/drivers/net/ethernet/rocker
Duoming Zhou c0955bf957 ethernet: rocker: fix sleep in atomic context bug in neigh_timer_handler
The function neigh_timer_handler() is a timer handler that runs in an
atomic context. When used by rocker, neigh_timer_handler() calls
"kzalloc(.., GFP_KERNEL)" that may sleep. As a result, the sleep in
atomic context bug will happen. One of the processes is shown below:

ofdpa_fib4_add()
 ...
 neigh_add_timer()

(wait a timer)

neigh_timer_handler()
 neigh_release()
  neigh_destroy()
   rocker_port_neigh_destroy()
    rocker_world_port_neigh_destroy()
     ofdpa_port_neigh_destroy()
      ofdpa_port_ipv4_neigh()
       kzalloc(sizeof(.., GFP_KERNEL) //may sleep

This patch changes the gfp_t parameter of kzalloc() from GFP_KERNEL to
GFP_ATOMIC in order to mitigate the bug.

Fixes: 00fc0c51e3 ("rocker: Change world_ops API and implementation to be switchdev independant")
Signed-off-by: Duoming Zhou <duoming@zju.edu.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
2022-08-31 14:01:29 +01:00
..
Kconfig ethernet: select CONFIG_CRC32 as needed 2020-12-04 14:42:21 -08:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
rocker_hw.h PCI: Move PCI_VENDOR_ID_REDHAT definition to pci_ids.h 2020-07-09 17:00:47 -05:00
rocker_main.c net: switch to netif_napi_add_tx() 2022-05-05 15:54:12 -07:00
rocker_ofdpa.c ethernet: rocker: fix sleep in atomic context bug in neigh_timer_handler 2022-08-31 14:01:29 +01:00
rocker_tlv.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
rocker_tlv.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
rocker.h net: bridge: switchdev: let drivers inform which bridge ports are offloaded 2021-07-22 00:26:23 -07:00