From: Mike Christie <michael.christie@oracle.com>
To: Dmitry Bogdanov <d.bogdanov@yadro.com>
Cc: mlombard@redhat.com, martin.petersen@oracle.com,
linux-scsi@vger.kernel.org, target-devel@vger.kernel.org
Subject: Re: [PATCH 5/7] scsi: target: iscsit/isert: stop/wait on cmds during conn close
Date: Sat, 10 Dec 2022 19:38:40 -0600 [thread overview]
Message-ID: <785b5eab-8e2c-b5c3-e710-d16abe2a2154@oracle.com> (raw)
In-Reply-To: <5282eea8-6648-4573-057b-7350955b2368@oracle.com>
On 12/10/22 12:48 PM, Mike Christie wrote:
>
> When we do iscsit iscsit_release_commands_from_conn we are:
>
> 1. Waiting on commands in the backend and LIO core.
> 2. Doing the last put on commands that have had queue_status called but
> we haven't freed the cmd because they haven't been ackd.
>
> Are we hitting an issue with #2? We need a proper bug and analysis or we are
> just guessing and am going to mess up.
>
> For example, for isert is the bug you are worried about that we have a missing
> isert_send_done/isert_completion_put call because we disconnected before the
> send callbacks could be done or because the ib layer won't call isert_send_done
> when it detects a failure?
I tested this and it's actually opposite and broken for a different reason :)
It looks like we will still call isert_send_done for the cases above so we are
ok there. The target_wait_for_cmds call will also sync us up those calls as
well. So if we move isert's target_wait_for_cmds we have to flush those calls
as well or add some more checks/refcounts or something.
It turns out instead of a hang there is use after free. We can race where
isert_put_unsol_pending_cmds does a isert_put_cmd but then isert_send_done
can be running and also does isert_completion_put -> isert_put_cmd, so we
hit a use after free due to the isert_put_unsol_pending_cmds calls freeing
the se_cmd.
next prev parent reply other threads:[~2022-12-11 1:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-08 3:09 [PATCH 0/7] scsi target task management fixes Mike Christie
2022-12-08 3:09 ` [PATCH 1/7] scsi: target: Move sess cmd counter to new struct Mike Christie
2022-12-08 3:09 ` [PATCH 2/7] scsi: target: Move cmd counter allocation Mike Christie
2022-12-08 3:09 ` [PATCH 3/7] scsi: target: Pass in cmd counter to use during cmd setup Mike Christie
2022-12-08 3:09 ` [PATCH 4/7] scsi: target: iscsit: Alloc per conn cmd counter Mike Christie
2022-12-08 3:10 ` [PATCH 5/7] scsi: target: iscsit/isert: stop/wait on cmds during conn close Mike Christie
2022-12-09 12:32 ` Dmitry Bogdanov
2022-12-10 18:48 ` Mike Christie
2022-12-11 1:38 ` Mike Christie [this message]
2023-01-12 3:11 ` Mike Christie
2022-12-11 1:20 ` Mike Christie
2022-12-08 3:10 ` [PATCH 6/7] scsi: target: drop tas arg from __transport_wait_for_tasks Mike Christie
2022-12-08 9:24 ` Dmitry Bogdanov
2022-12-08 3:10 ` [PATCH 7/7] scsi: target: Fix multiple LUN_RESET handling Mike Christie
2022-12-08 9:21 ` Dmitry Bogdanov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=785b5eab-8e2c-b5c3-e710-d16abe2a2154@oracle.com \
--to=michael.christie@oracle.com \
--cc=d.bogdanov@yadro.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=mlombard@redhat.com \
--cc=target-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox