linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] mfd: ezx-pcap: Possible sleep-in-atomic-context bugs in pcap_adc_irq()
@ 2018-09-15  8:50 Jia-Ju Bai
  2018-09-17  1:03 ` Lee Jones
  0 siblings, 1 reply; 5+ messages in thread
From: Jia-Ju Bai @ 2018-09-15  8:50 UTC (permalink / raw)
  To: lee.jones; +Cc: Linux Kernel Mailing List

The driver may sleep in an interrupt handler.
The function call paths (from bottom to top) in Linux-4.17 are:

[FUNC] mutex_lock_nested
drivers/mfd/ezx-pcap.c, 272:
     mutex_lock_nested in pcap_adc_irq (interrupt handler)

[FUNC] mutex_lock_nested
drivers/mfd/ezx-pcap.c, 100:
     mutex_lock_nested in ezx_pcap_read
drivers/mfd/ezx-pcap.c, 281:
     ezx_pcap_read in pcap_adc_irq (interrupt handler)

[FUNC] mutex_lock_nested
drivers/mfd/ezx-pcap.c, 85:
     mutex_lock_nested in ezx_pcap_write
drivers/mfd/ezx-pcap.c, 285:
     ezx_pcap_write in pcap_adc_irq (interrupt handler)

[FUNC] mutex_lock_nested
drivers/mfd/ezx-pcap.c, 244:
     mutex_lock_nested in pcap_adc_trigger
drivers/mfd/ezx-pcap.c, 299:
     pcap_adc_trigger in pcap_adc_irq (interrupt handler)

These bugs are found by my static analysis tool DSAC.


Best wishes,
Jia-Ju Bai

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] mfd: ezx-pcap: Possible sleep-in-atomic-context bugs in pcap_adc_irq()
  2018-09-15  8:50 [BUG] mfd: ezx-pcap: Possible sleep-in-atomic-context bugs in pcap_adc_irq() Jia-Ju Bai
@ 2018-09-17  1:03 ` Lee Jones
  2018-09-17  2:46   ` Jia-Ju Bai
  0 siblings, 1 reply; 5+ messages in thread
From: Lee Jones @ 2018-09-17  1:03 UTC (permalink / raw)
  To: Jia-Ju Bai; +Cc: Linux Kernel Mailing List

On Sat, 15 Sep 2018, Jia-Ju Bai wrote:

> The driver may sleep in an interrupt handler.
> The function call paths (from bottom to top) in Linux-4.17 are:
> 
> [FUNC] mutex_lock_nested
> drivers/mfd/ezx-pcap.c, 272:
>     mutex_lock_nested in pcap_adc_irq (interrupt handler)
> 
> [FUNC] mutex_lock_nested
> drivers/mfd/ezx-pcap.c, 100:
>     mutex_lock_nested in ezx_pcap_read
> drivers/mfd/ezx-pcap.c, 281:
>     ezx_pcap_read in pcap_adc_irq (interrupt handler)
> 
> [FUNC] mutex_lock_nested
> drivers/mfd/ezx-pcap.c, 85:
>     mutex_lock_nested in ezx_pcap_write
> drivers/mfd/ezx-pcap.c, 285:
>     ezx_pcap_write in pcap_adc_irq (interrupt handler)
> 
> [FUNC] mutex_lock_nested
> drivers/mfd/ezx-pcap.c, 244:
>     mutex_lock_nested in pcap_adc_trigger
> drivers/mfd/ezx-pcap.c, 299:
>     pcap_adc_trigger in pcap_adc_irq (interrupt handler)
> 
> These bugs are found by my static analysis tool DSAC.

Not sure what you want me to do with this.

Do you have something in mind?

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] mfd: ezx-pcap: Possible sleep-in-atomic-context bugs in pcap_adc_irq()
  2018-09-17  1:03 ` Lee Jones
@ 2018-09-17  2:46   ` Jia-Ju Bai
  2018-10-09  9:07     ` Lee Jones
  0 siblings, 1 reply; 5+ messages in thread
From: Jia-Ju Bai @ 2018-09-17  2:46 UTC (permalink / raw)
  To: Lee Jones; +Cc: Linux Kernel Mailing List



On 2018/9/17 9:03, Lee Jones wrote:
> On Sat, 15 Sep 2018, Jia-Ju Bai wrote:
>
>> The driver may sleep in an interrupt handler.
>> The function call paths (from bottom to top) in Linux-4.17 are:
>>
>> [FUNC] mutex_lock_nested
>> drivers/mfd/ezx-pcap.c, 272:
>>      mutex_lock_nested in pcap_adc_irq (interrupt handler)
>>
>> [FUNC] mutex_lock_nested
>> drivers/mfd/ezx-pcap.c, 100:
>>      mutex_lock_nested in ezx_pcap_read
>> drivers/mfd/ezx-pcap.c, 281:
>>      ezx_pcap_read in pcap_adc_irq (interrupt handler)
>>
>> [FUNC] mutex_lock_nested
>> drivers/mfd/ezx-pcap.c, 85:
>>      mutex_lock_nested in ezx_pcap_write
>> drivers/mfd/ezx-pcap.c, 285:
>>      ezx_pcap_write in pcap_adc_irq (interrupt handler)
>>
>> [FUNC] mutex_lock_nested
>> drivers/mfd/ezx-pcap.c, 244:
>>      mutex_lock_nested in pcap_adc_trigger
>> drivers/mfd/ezx-pcap.c, 299:
>>      pcap_adc_trigger in pcap_adc_irq (interrupt handler)
>>
>> These bugs are found by my static analysis tool DSAC.
> Not sure what you want me to do with this.
>
> Do you have something in mind?
>

I find some possible bugs in this driver, but I do not know how to 
correctly fix them...
Could you find a good solution?


Best wishes,
Jia-Ju Bai

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] mfd: ezx-pcap: Possible sleep-in-atomic-context bugs in pcap_adc_irq()
  2018-09-17  2:46   ` Jia-Ju Bai
@ 2018-10-09  9:07     ` Lee Jones
  2018-10-10  7:31       ` Jia-Ju Bai
  0 siblings, 1 reply; 5+ messages in thread
From: Lee Jones @ 2018-10-09  9:07 UTC (permalink / raw)
  To: Jia-Ju Bai; +Cc: Linux Kernel Mailing List

On Mon, 17 Sep 2018, Jia-Ju Bai wrote:

> 
> 
> On 2018/9/17 9:03, Lee Jones wrote:
> > On Sat, 15 Sep 2018, Jia-Ju Bai wrote:
> > 
> > > The driver may sleep in an interrupt handler.
> > > The function call paths (from bottom to top) in Linux-4.17 are:
> > > 
> > > [FUNC] mutex_lock_nested
> > > drivers/mfd/ezx-pcap.c, 272:
> > >      mutex_lock_nested in pcap_adc_irq (interrupt handler)
> > > 
> > > [FUNC] mutex_lock_nested
> > > drivers/mfd/ezx-pcap.c, 100:
> > >      mutex_lock_nested in ezx_pcap_read
> > > drivers/mfd/ezx-pcap.c, 281:
> > >      ezx_pcap_read in pcap_adc_irq (interrupt handler)
> > > 
> > > [FUNC] mutex_lock_nested
> > > drivers/mfd/ezx-pcap.c, 85:
> > >      mutex_lock_nested in ezx_pcap_write
> > > drivers/mfd/ezx-pcap.c, 285:
> > >      ezx_pcap_write in pcap_adc_irq (interrupt handler)
> > > 
> > > [FUNC] mutex_lock_nested
> > > drivers/mfd/ezx-pcap.c, 244:
> > >      mutex_lock_nested in pcap_adc_trigger
> > > drivers/mfd/ezx-pcap.c, 299:
> > >      pcap_adc_trigger in pcap_adc_irq (interrupt handler)
> > > 
> > > These bugs are found by my static analysis tool DSAC.
> > Not sure what you want me to do with this.
> > 
> > Do you have something in mind?
> > 
> 
> I find some possible bugs in this driver, but I do not know how to correctly
> fix them...
> Could you find a good solution?

If you have found bugs and do not intend on fixing them, please report
them via the 'File a Bug' option here:

  https://bugzilla.kernel.org/

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] mfd: ezx-pcap: Possible sleep-in-atomic-context bugs in pcap_adc_irq()
  2018-10-09  9:07     ` Lee Jones
@ 2018-10-10  7:31       ` Jia-Ju Bai
  0 siblings, 0 replies; 5+ messages in thread
From: Jia-Ju Bai @ 2018-10-10  7:31 UTC (permalink / raw)
  To: Lee Jones; +Cc: Linux Kernel Mailing List



On 2018/10/9 17:07, Lee Jones wrote:
> On Mon, 17 Sep 2018, Jia-Ju Bai wrote:
>
>>
>> On 2018/9/17 9:03, Lee Jones wrote:
>>> On Sat, 15 Sep 2018, Jia-Ju Bai wrote:
>>>
>>>> The driver may sleep in an interrupt handler.
>>>> The function call paths (from bottom to top) in Linux-4.17 are:
>>>>
>>>> [FUNC] mutex_lock_nested
>>>> drivers/mfd/ezx-pcap.c, 272:
>>>>       mutex_lock_nested in pcap_adc_irq (interrupt handler)
>>>>
>>>> [FUNC] mutex_lock_nested
>>>> drivers/mfd/ezx-pcap.c, 100:
>>>>       mutex_lock_nested in ezx_pcap_read
>>>> drivers/mfd/ezx-pcap.c, 281:
>>>>       ezx_pcap_read in pcap_adc_irq (interrupt handler)
>>>>
>>>> [FUNC] mutex_lock_nested
>>>> drivers/mfd/ezx-pcap.c, 85:
>>>>       mutex_lock_nested in ezx_pcap_write
>>>> drivers/mfd/ezx-pcap.c, 285:
>>>>       ezx_pcap_write in pcap_adc_irq (interrupt handler)
>>>>
>>>> [FUNC] mutex_lock_nested
>>>> drivers/mfd/ezx-pcap.c, 244:
>>>>       mutex_lock_nested in pcap_adc_trigger
>>>> drivers/mfd/ezx-pcap.c, 299:
>>>>       pcap_adc_trigger in pcap_adc_irq (interrupt handler)
>>>>
>>>> These bugs are found by my static analysis tool DSAC.
>>> Not sure what you want me to do with this.
>>>
>>> Do you have something in mind?
>>>
>> I find some possible bugs in this driver, but I do not know how to correctly
>> fix them...
>> Could you find a good solution?
> If you have found bugs and do not intend on fixing them, please report
> them via the 'File a Bug' option here:
>
>    https://bugzilla.kernel.org/
>

Okay, thanks.


Best wishes,
Jia-Ju Bai

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-10-10  7:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-15  8:50 [BUG] mfd: ezx-pcap: Possible sleep-in-atomic-context bugs in pcap_adc_irq() Jia-Ju Bai
2018-09-17  1:03 ` Lee Jones
2018-09-17  2:46   ` Jia-Ju Bai
2018-10-09  9:07     ` Lee Jones
2018-10-10  7:31       ` Jia-Ju Bai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).