* [BUG] scsi/qla2xxx: a possible sleep-in-atomic bug in qlt_get_tag
@ 2017-12-13 3:18 Jia-Ju Bai
2017-12-13 4:42 ` James Bottomley
0 siblings, 1 reply; 3+ messages in thread
From: Jia-Ju Bai @ 2017-12-13 3:18 UTC (permalink / raw)
To: qla2xxx-upstream, jejb, martin.petersen
Cc: linux-scsi, Linux Kernel Mailing List
The driver may sleep under a spinlock.
The function call paths are:
qlt_handle_abts_recv_work (acquire the spinlock)
qlt_response_pkt_all_vps
qlt_response_pkt
qlt_handle_cmd_for_atio
qlt_get_tag
percpu_ida_alloc --> may sleep
qla82xx_msix_rsp_q (acquire the spinlock)
qla24xx_process_response_queue
qlt_handle_abts_recv
qlt_response_pkt_all_vps
qlt_response_pkt
qlt_handle_cmd_for_atio
qlt_get_tag
percpu_ida_alloc --> may sleep-in-atomic
qla24xx_intr_handler (acquire the spinlock)
qla24xx_process_response_queue
qlt_handle_abts_recv
qlt_response_pkt
qlt_handle_cmd_for_atio
qlt_get_tag
percpu_ida_alloc --> may sleep
I do not find a good way to fix it, so I only report.
This possible bug is found by my static analysis tool (DSAC) and checked
by my code review.
Thanks,
Jia-Ju Bai
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [BUG] scsi/qla2xxx: a possible sleep-in-atomic bug in qlt_get_tag
2017-12-13 3:18 [BUG] scsi/qla2xxx: a possible sleep-in-atomic bug in qlt_get_tag Jia-Ju Bai
@ 2017-12-13 4:42 ` James Bottomley
2017-12-13 7:38 ` Jia-Ju Bai
0 siblings, 1 reply; 3+ messages in thread
From: James Bottomley @ 2017-12-13 4:42 UTC (permalink / raw)
To: Jia-Ju Bai, qla2xxx-upstream, martin.petersen
Cc: linux-scsi, Linux Kernel Mailing List
On Wed, 2017-12-13 at 11:18 +0800, Jia-Ju Bai wrote:
> The driver may sleep under a spinlock.
> The function call paths are:
> qlt_handle_abts_recv_work (acquire the spinlock)
> qlt_response_pkt_all_vps
> qlt_response_pkt
> qlt_handle_cmd_for_atio
> qlt_get_tag
> percpu_ida_alloc --> may sleep
>
> qla82xx_msix_rsp_q (acquire the spinlock)
> qla24xx_process_response_queue
> qlt_handle_abts_recv
> qlt_response_pkt_all_vps
> qlt_response_pkt
> qlt_handle_cmd_for_atio
> qlt_get_tag
> percpu_ida_alloc --> may sleep-in-atomic
>
> qla24xx_intr_handler (acquire the spinlock)
> qla24xx_process_response_queue
> qlt_handle_abts_recv
> qlt_response_pkt
> qlt_handle_cmd_for_atio
> qlt_get_tag
> percpu_ida_alloc --> may sleep
>
> I do not find a good way to fix it, so I only report.
> This possible bug is found by my static analysis tool (DSAC) and
> checked by my code review.
The report is incorrect: percpu_ida_alloc with state==TASK_RUNNING is
atomic (and interrupt) safe which appears to be the case here.
James
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [BUG] scsi/qla2xxx: a possible sleep-in-atomic bug in qlt_get_tag
2017-12-13 4:42 ` James Bottomley
@ 2017-12-13 7:38 ` Jia-Ju Bai
0 siblings, 0 replies; 3+ messages in thread
From: Jia-Ju Bai @ 2017-12-13 7:38 UTC (permalink / raw)
To: James Bottomley, qla2xxx-upstream, martin.petersen
Cc: linux-scsi, Linux Kernel Mailing List
On 2017/12/13 12:42, James Bottomley wrote:
> On Wed, 2017-12-13 at 11:18 +0800, Jia-Ju Bai wrote:
>> The driver may sleep under a spinlock.
>> The function call paths are:
>> qlt_handle_abts_recv_work (acquire the spinlock)
>> qlt_response_pkt_all_vps
>> qlt_response_pkt
>> qlt_handle_cmd_for_atio
>> qlt_get_tag
>> percpu_ida_alloc --> may sleep
>>
>> qla82xx_msix_rsp_q (acquire the spinlock)
>> qla24xx_process_response_queue
>> qlt_handle_abts_recv
>> qlt_response_pkt_all_vps
>> qlt_response_pkt
>> qlt_handle_cmd_for_atio
>> qlt_get_tag
>> percpu_ida_alloc --> may sleep-in-atomic
>>
>> qla24xx_intr_handler (acquire the spinlock)
>> qla24xx_process_response_queue
>> qlt_handle_abts_recv
>> qlt_response_pkt
>> qlt_handle_cmd_for_atio
>> qlt_get_tag
>> percpu_ida_alloc --> may sleep
>>
>> I do not find a good way to fix it, so I only report.
>> This possible bug is found by my static analysis tool (DSAC) and
>> checked by my code review.
> The report is incorrect: percpu_ida_alloc with state==TASK_RUNNING is
> atomic (and interrupt) safe which appears to be the case here.
>
> James
>
Thanks for your reply :)
I have checked the definition of percpu_ida_alloc, and I think you are
right.
Sorry for my incorrect bug report.
Thanks,
Jia-Ju Bai
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-12-13 7:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-13 3:18 [BUG] scsi/qla2xxx: a possible sleep-in-atomic bug in qlt_get_tag Jia-Ju Bai
2017-12-13 4:42 ` James Bottomley
2017-12-13 7:38 ` 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