diff options
author | Duoming Zhou <duoming@zju.edu.cn> | 2022-08-27 23:38:15 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-09-15 12:17:02 +0200 |
commit | 11f1e0c95e6d4774c56ec78cb8c5597554da3c08 (patch) | |
tree | 6d6d2ff52393cefceb5fbce99d3aaef8f5e5e0a0 /net | |
parent | 4f63e0c9d1a1542f311387bf9ca670469a48ed68 (diff) | |
download | linux-stable-11f1e0c95e6d4774c56ec78cb8c5597554da3c08.tar.gz linux-stable-11f1e0c95e6d4774c56ec78cb8c5597554da3c08.tar.bz2 linux-stable-11f1e0c95e6d4774c56ec78cb8c5597554da3c08.zip |
ethernet: rocker: fix sleep in atomic context bug in neigh_timer_handler
[ Upstream commit c0955bf957be4bead01fae1d791476260da7325d ]
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: 00fc0c51e35b ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
0 files changed, 0 insertions, 0 deletions