Files
linux/drivers
Jia-Ju Bai 8590e6fecb net: cadence: Fix a sleep-in-atomic-context bug in macb_halt_tx()
[ Upstream commit 16fe10cf92 ]

The kernel module may sleep with holding a spinlock.

The function call paths (from bottom to top) in Linux-4.16 are:

[FUNC] usleep_range
drivers/net/ethernet/cadence/macb_main.c, 648:
	usleep_range in macb_halt_tx
drivers/net/ethernet/cadence/macb_main.c, 730:
	macb_halt_tx in macb_tx_error_task
drivers/net/ethernet/cadence/macb_main.c, 721:
	_raw_spin_lock_irqsave in macb_tx_error_task

To fix this bug, usleep_range() is replaced with udelay().

This bug is found by my static analysis tool DSAC.

Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-10 08:54:21 +02:00
..
2018-10-03 17:00:59 -07:00
2018-07-22 14:28:43 +02:00
2018-07-03 11:24:56 +02:00
2018-08-22 07:46:11 +02:00
2018-01-17 09:45:27 +01:00
2018-08-24 13:09:06 +02:00
2018-07-25 11:25:10 +02:00
2018-09-15 09:45:27 +02:00
2018-10-03 17:00:46 -07:00