linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: yebin <yebin10@huawei.com>,
	jejb@linux.ibm.com, martin.petersen@oracle.com,
	linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATH v2] scsi: scsi_dh_rdac: Avoid crash during rdac_bus_attach
Date: Wed, 28 Jul 2021 14:55:19 -0700	[thread overview]
Message-ID: <1a86eadf-41fe-256e-2656-b9a13f73d88f@acm.org> (raw)
In-Reply-To: <61016887.9000200@huawei.com>

On 7/28/21 7:24 AM, yebin wrote:
> On 2021/7/23 12:04, Bart Van Assche wrote:
>> On 1/12/21 10:31 PM, Ye Bin wrote:
>>>       sdev->handler_data = NULL;
>>> +    synchronize_rcu();
>>>       kfree(h);
>> What is the purpose of the new synchronize_rcu() call?
> Thanks for your reply.
> Yes, I add new synchronize_rcu() call is to wait until *h is no longer 
> in use. If free
> "h" right now , mybe lead to UAF.
>> If its purpose is
>> to wait until *h is no longer in use, please use kfree_rcu() instead.
> struct rdac_dh_data {
>          struct list_head        node;
>          .....
> }
> As rdac_dh_data.node type is "struct list_head", but  kfree_rcu the 
> first parameter type is
> "struct rcu_head". So we can only use synchronize_rcu() at here.

Ah, that's right. Hence:

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

  reply	other threads:[~2021-07-28 21:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13  6:31 Ye Bin
2021-07-22 13:09 ` yebin
2021-07-23  4:04 ` Bart Van Assche
2021-07-28 14:24   ` yebin
2021-07-28 21:55     ` Bart Van Assche [this message]
2021-07-29  3:37 ` Martin K. Petersen

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=1a86eadf-41fe-256e-2656-b9a13f73d88f@acm.org \
    --to=bvanassche@acm.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=yebin10@huawei.com \
    --subject='Re: [PATH v2] scsi: scsi_dh_rdac: Avoid crash during rdac_bus_attach' \
    /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

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).