All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Ming Lei <ming.lei@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>, Christoph Hellwig <hch@lst.de>,
	linux-block@vger.kernel.org, Jan Kara <jack@suse.cz>
Subject: Re: [PATCH V3 2/3] blk-mq: avoid to touch q->elevator without any protection
Date: Thu, 16 Jun 2022 08:15:00 +0200	[thread overview]
Message-ID: <20220616061500.GA5144@lst.de> (raw)
In-Reply-To: <20220616014401.817001-3-ming.lei@redhat.com>

On Thu, Jun 16, 2022 at 09:44:00AM +0800, Ming Lei wrote:
> q->elevator is referred in blk_mq_has_sqsched() without any protection,
> no .q_usage_counter is held, no queue srcu and rcu read lock is held,
> so potential use-after-free may be triggered.
> 
> Fix the issue by adding one queue flag for checking if the elevator
> uses single queue style dispatch. Meantime the elevator feature flag
> of ELEVATOR_F_MQ_AWARE isn't needed any more.

I think clearing in common code would be safer, but this does work
as-is, so:

Reviewed-by: Christoph Hellwig <hch@lst.de>

  reply	other threads:[~2022-06-16  6:15 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-16  1:43 [PATCH V3 0/3] blk-mq: three misc patches Ming Lei
2022-06-16  1:43 ` [PATCH V3 1/3] blk-mq: protect q->elevator by ->sysfs_lock in blk_mq_elv_switch_none Ming Lei
2022-06-16  1:44 ` [PATCH V3 2/3] blk-mq: avoid to touch q->elevator without any protection Ming Lei
2022-06-16  6:15   ` Christoph Hellwig [this message]
2022-06-16  1:44 ` [PATCH V3 3/3] blk-mq: don't clear flush_rq from tags->rqs[] Ming Lei
2022-06-16 20:46 ` [PATCH V3 0/3] blk-mq: three misc patches Jens Axboe

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=20220616061500.GA5144@lst.de \
    --to=hch@lst.de \
    --cc=axboe@kernel.dk \
    --cc=jack@suse.cz \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.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.