From: Wenchao Hao <haowenchao@huawei.com>
To: Hannes Reinecke <hare@suse.de>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Martin K. Petersen" <martin.petersen@oracle.com>,
<linux-scsi@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Feilong Lin <linfeilong@huawei.com>
Subject: Re: [Question] SCSI_EH: How does EH guarantee there is no UAF of scsi_cmnd if host reset failed
Date: Thu, 21 Apr 2022 23:24:36 +0800 [thread overview]
Message-ID: <b6777ef0-629c-0bb6-da5a-6aef096b6079@huawei.com> (raw)
In-Reply-To: <da087e9b-bd07-e5fd-421d-242e6adce22b@suse.de>
On 2022/4/19 22:56, Hannes Reinecke wrote:
> On 4/19/22 16:28, Wenchao Hao wrote:
>> Hi all, I am wondered how does SCSI EH guarantee there is no UAF of scsi_cmnd
>> if host reset failed. If host reset failed and eh_cmd_q of shost is not empty,
>> these command in eh_cmd_q would be added to done_q in scsi_eh_offline_sdevs()
>> and finished by scsi_eh_flush_done_q(). So these scsi_cmnd and it's related
>> request would be freed.
>>
> Yes.
>
>> While since host reset failed, we can not guarantee the LLDDs has cleared all
>> references to these commands in eh_cmd_q. Is there any possibility that the
>> LLDDs reference to these commands? If this happened, then a using after free
>> issue would occur.
>>
> If host reset has failed there are _no_ assumptions we can make about commands, and not even about the PCI device itself.
> So in effect, once host_reset failed the system is hosed.
>
> We _might_ be able to resurrect the system by doing PCI EEH, but not many systems nor drivers implement that.
>
> Cheers,
>
> Hannes
>
> .
Thanks a lot for your reply. I am writing single LUN reset EH flow which discussed in previous mail
and testing it, if the test result is good I would post it.
By the way, you said you would make EH rework, are you doing it? Could you tell us your plan
if it's not secret.
prev parent reply other threads:[~2022-04-21 15:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-19 14:28 Wenchao Hao
2022-04-19 14:56 ` Hannes Reinecke
2022-04-21 15:24 ` Wenchao Hao [this message]
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=b6777ef0-629c-0bb6-da5a-6aef096b6079@huawei.com \
--to=haowenchao@huawei.com \
--cc=hare@suse.de \
--cc=jejb@linux.ibm.com \
--cc=linfeilong@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/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
all inboxes | Powered by JetHome®