[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20171021110943.0e4f3a24@wiggum>
Date: Sat, 21 Oct 2017 11:09:43 +0200
From: Michael Büsch <m@...s.ch>
To: Jia-Ju Bai <baijiaju1990@....com>
Cc: gregkh@...uxfoundation.org, sudipm.mukherjee@...il.com,
akpm@...ux-foundation.org, johannes@...solutions.net,
dahinds@...rs.sourceforge.net, linux-pcmcia@...ts.infradead.org,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-wireless@...r.kernel.org
Subject: Re: [BUG] ssb: Possible sleep-in-atomic bugs in ssb_pcmcia_read8
On Mon, 9 Oct 2017 09:29:17 +0800
Jia-Ju Bai <baijiaju1990@....com> wrote:
> 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 for scanning and your resulting bug notification.
I currently don't have the hardware at hand to develop and test a
proper fix for this.
That said, I'm not so sure anymore why bar_lock is a spinlock instead
of a mutex. It might be possible to convert this to mutex.
I will try to look into this.
--
Michael
Content of type "application/pgp-signature" skipped
Powered by blists - more mailing lists