Re: [PATCH V2 2/3] blk-mq: avoid to touch q->elevator without any protection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 15, 2022 at 08:50:34AM +0200, Christoph Hellwig wrote:
> On Wed, Jun 15, 2022 at 02:48:25PM +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.
> 
> We still need to clear the flag when switching elevators.

Indeed, or it can be cleared in initializing none and kyber. 

Thanks,
Ming




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux