Commit 8b1dd49a authored by Pavel Andrianov's avatar Pavel Andrianov Committed by Zheng Zengkai
Browse files

net: pxa168_eth: Fix a potential data race in pxa168_eth_remove



stable inclusion
from stable-5.10.29
commit f0ed115feccc6073abcd982b2e6e6d048d2dbfd8
bugzilla: 51789

--------------------------------

[ Upstream commit 0571a753 ]

pxa168_eth_remove() firstly calls unregister_netdev(),
then cancels a timeout work. unregister_netdev() shuts down a device
interface and removes it from the kernel tables. If the timeout occurs
in parallel, the timeout work (pxa168_eth_tx_timeout_task) performs stop
and open of the device. It may lead to an inconsistent state and memory
leaks.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: default avatarPavel Andrianov <andrianov@ispras.ru>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatar  Weilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 02e0d49c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment