diff options
author | Jia-Ju Bai <baijiaju1990@gmail.com> | 2019-12-18 10:44:05 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-14 15:27:51 +0100 |
commit | b74351287d4bd90636c3f48bc188c2f53824c2d4 (patch) | |
tree | b90124de8b435f7abaaefe76a4c03dfa96b4934f /drivers/uio/uio_pdrv_genirq.c | |
parent | misc: xilinx_sdfec: fix xsdfec_poll()'s return type (diff) | |
download | linux-b74351287d4bd90636c3f48bc188c2f53824c2d4.tar.xz linux-b74351287d4bd90636c3f48bc188c2f53824c2d4.zip |
uio: fix a sleep-in-atomic-context bug in uio_dmem_genirq_irqcontrol()
The driver may sleep while holding a spinlock.
The function call path (from bottom to top) in Linux 4.19 is:
kernel/irq/manage.c, 523:
synchronize_irq in disable_irq
drivers/uio/uio_dmem_genirq.c, 140:
disable_irq in uio_dmem_genirq_irqcontrol
drivers/uio/uio_dmem_genirq.c, 134:
_raw_spin_lock_irqsave in uio_dmem_genirq_irqcontrol
synchronize_irq() can sleep at runtime.
To fix this bug, disable_irq() is called without holding the spinlock.
This bug is found by a static analysis tool STCheck written by myself.
Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Link: https://lore.kernel.org/r/20191218094405.6009-1-baijiaju1990@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/uio/uio_pdrv_genirq.c')
0 files changed, 0 insertions, 0 deletions