diff options
author | Chengfeng Ye <dg573847474@gmail.com> | 2023-09-26 10:29:14 +0000 |
---|---|---|
committer | Bartosz Golaszewski <bartosz.golaszewski@linaro.org> | 2023-09-27 08:51:28 +0200 |
commit | 9e8bc2dda5a7a8e2babc9975f4b11c9a6196e490 (patch) | |
tree | 4a4af47269e8c93e5ebb80474928652547d81e50 /scripts/gdb/linux/vmalloc.py | |
parent | 6465e260f48790807eef06b583b38ca9789b6072 (diff) |
gpio: timberdale: Fix potential deadlock on &tgpio->lock
As timbgpio_irq_enable()/timbgpio_irq_disable() callback could be
executed under irq context, it could introduce double locks on
&tgpio->lock if it preempts other execution units requiring
the same locks.
timbgpio_gpio_set()
--> timbgpio_update_bit()
--> spin_lock(&tgpio->lock)
<interrupt>
--> timbgpio_irq_disable()
--> spin_lock_irqsave(&tgpio->lock)
This flaw was found by an experimental static analysis tool I am
developing for irq-related deadlock.
To prevent the potential deadlock, the patch uses spin_lock_irqsave()
on &tgpio->lock inside timbgpio_gpio_set() to prevent the possible
deadlock scenario.
Signed-off-by: Chengfeng Ye <dg573847474@gmail.com>
Reviewed-by: Andy Shevchenko <andy@kernel.org>
Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
Diffstat (limited to 'scripts/gdb/linux/vmalloc.py')
0 files changed, 0 insertions, 0 deletions