All of lore.kernel.org
 help / color / mirror / Atom feed
From: paulmck@linux.ibm.com (Paul E. McKenney)
Subject: v5.0-rc2 and NVMeOF
Date: Tue, 12 Feb 2019 17:07:44 -0800	[thread overview]
Message-ID: <20190213010744.GW4240@linux.ibm.com> (raw)
In-Reply-To: <1550018836.19311.47.camel@acm.org>

On Tue, Feb 12, 2019@04:47:16PM -0800, Bart Van Assche wrote:
> On Tue, 2019-02-12@09:47 -0800, Paul E. McKenney wrote:
> > It looks to me like you need an srcu_barrier(&head->srcu) just before
> > the call to cleanup_srcu_struct_quiesced() in nvme_free_ns_head().
> > Or maybe earlier in the cleanup flow, but most definitely -after- the
> > last invocation of call_srcu().
> > 
> > Does that help?  Or is there a call to srcu_barrier() somewhere that I
> > am blind to?
> 
> Hi Paul,
> 
> Even with this patch applied I still see the KASAN use-after-free warning:
> 
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 6a9dd68c0f4f..f2e47af6f8ee 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -391,6 +391,7 @@ static void nvme_free_ns_head(struct kref *ref)
>         nvme_mpath_remove_disk(head);
>         ida_simple_remove(&head->subsys->ns_ida, head->instance);
>         list_del_init(&head->entry);
> +       srcu_barrier(&head->srcu);
>         cleanup_srcu_struct_quiesced(&head->srcu);
>         nvme_put_subsystem(head->subsys);
>         kfree(head);
> 
> Does that mean that I misunderstood you?

That is in fact what I was asking you to do.  So perhaps I misunderstood
your code.  Some questions:

1.	Are there any other places that either cleanup_srcu_struct()
	or cleanup_srcu_struct_quiesced() are invoked?  If so, it is
	possible that the others also need srcu_barrier().

2.	What prevents call_srcu() from being invoked about the
	time that cleanup_srcu_struct_quiesced() is called?

							Thanx, Paul

      reply	other threads:[~2019-02-13  1:07 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-15 19:07 v5.0-rc2 and NVMeOF Bart Van Assche
2019-01-17  1:16 ` Sagi Grimberg
2019-02-11 17:24   ` Bart Van Assche
2019-02-11 21:08     ` Paul E. McKenney
2019-02-11 22:27       ` Bart Van Assche
2019-02-12  1:24         ` Paul E. McKenney
2019-02-12 16:47           ` Bart Van Assche
2019-02-12 17:47             ` Paul E. McKenney
2019-02-12 19:15               ` Paul E. McKenney
2019-02-13  0:44                 ` Bart Van Assche
2019-02-13  1:10                   ` Paul E. McKenney
2019-02-13 15:19                     ` Paul E. McKenney
2019-02-13 15:24                       ` Paul E. McKenney
2019-02-13 18:36                         ` Bart Van Assche
2019-02-13 18:48                           ` Paul E. McKenney
2019-02-13 19:12                             ` Bart Van Assche
2019-02-13 19:30                               ` Paul E. McKenney
2019-02-13 19:52                                 ` Paul E. McKenney
2019-02-13 21:00                                   ` Bart Van Assche
2019-02-13 22:09                                     ` Paul E. McKenney
2019-02-13 23:07                                       ` Paul E. McKenney
2019-02-14  0:21                                       ` Bart Van Assche
2019-02-14  1:02                                         ` Paul E. McKenney
2019-02-26 17:35                                           ` Paul E. McKenney
2019-02-26 17:47                                             ` Bart Van Assche
2019-02-26 18:12                                               ` Paul E. McKenney
2019-02-26 18:40                                                 ` Bart Van Assche
2019-02-26 19:20                                                   ` Paul E. McKenney
2019-02-26 23:48                                                     ` Bart Van Assche
2019-02-27 16:04                                                       ` Paul E. McKenney
2019-02-27 16:25                                                         ` Bart Van Assche
2019-02-27 18:22                                                           ` Paul E. McKenney
2019-02-13 19:13                         ` Paul E. McKenney
2019-02-13  0:47               ` Bart Van Assche
2019-02-13  1:07                 ` Paul E. McKenney [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=20190213010744.GW4240@linux.ibm.com \
    --to=paulmck@linux.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.