lkml.org 
[lkml]   [2017]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[BUG] ssb: Possible sleep-in-atomic bugs in ssb_pcmcia_read8
Date
According to pcmcia.c, the driver may sleep under a spinlock.
The function call paths are:
ssb_pcmcia_read8 (acquire the spinlock)
select_core_and_segment
ssb_pcmcia_switch_segment
ssb_pcmcia_cfg_write
pcmcia_write_config_byte
pcmcia_access_config (drivers/pcmcia/pcmcia_resource.c)
mutex_lock --> may sleep

ssb_pcmcia_read8 (acquire the spinlock)
select_core_and_segment
ssb_pcmcia_switch_segment
sssb_pcmcia_cfg_read
pcmcia_read_config_byte
pcmcia_access_config (drivers/pcmcia/pcmcia_resource.c)
mutex_lock --> may sleep

A possible fix is to use spinlock instead of mutex lock in
pcmcia_access_config in drivers/pcmcia/pcmcia_resource.c.

These bugs are found by my static analysis tool and my code review.


Thanks,
Jia-Ju Bai

\
 
 \ /
  Last update: 2017-10-09 03:30    [W:0.053 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site