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@xxxxxx>