lkml.org 
[lkml]   [2018]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] net: cadence: Fix a sleep-in-atomic-context bug in macb_halt_tx()
From
From: Jia-Ju Bai <baijiaju1990@gmail.com>
Date: Sat, 1 Sep 2018 20:11:05 +0800

> 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>

Applied, thanks.

\
 
 \ /
  Last update: 2018-09-03 01:06    [W:0.031 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site